Skip to content

Instantly share code, notes, and snippets.

View attila5287's full-sized avatar
💭
https://electiondataviz.herokuapp.com/

AttilaTurkoz attila5287

💭
https://electiondataviz.herokuapp.com/
View GitHub Profile
@attila5287
attila5287 / app_flask.py
Created October 26, 2018 11:33
DU week 10 - flask web framework app
# 1. import Flask
from flask import Flask
# 2. Create an app, being sure to pass __name__
app = Flask(__name__)
# 3. Define what to do when a user hits the index route
@app.route("/")
def home():
print("Server received request for 'Home' page...")
return "Welcome to my 'Home' page!"
from flask import Flask, render_template, request
import requests
app = Flask(__name__)
base_url = "https://api.github.com/users/"
@app.route("/", methods=["GET", "POST"])
def index():
if request.method == "POST":
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="UTF-8">
<title>My First Page</title>
</head>
<body>
<!-- Header -->
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="UTF-8">
<title>My First Page</title>
</head>
<body>
<!-- Header -->
@attila5287
attila5287 / unemployment.csv
Created September 13, 2020 22:47
BEA API two tables merged 1976-2001 and 2001-2019 for electiondataviz.herokuapp.com/interactive
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 45 columns, instead of 16 in line 5.
name,1976,1977,1978,1979,1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019
Alabama,8.7,8.75,8.8,8.85,8.9,10.6,14.1,13.8,11,9.2,9.7,8.1,7.2,7,6.8,7.3,7.6,7.3,6.2,6,5.2,5,4.4,4.7,4.6,5.1,5.9,6,5.7,4.5,4,4,5.7,11,10.5,9.6,8,7.2,6.8,6.1,5.8,4.4,3.9,3.9039
Alaska,9.4,9.45,9.5,9.55,9.6,9.4,9.9,9.9,9.8,9.7,10.9,10.3,8.8,7,7.2,8.5,8.9,7.7,7.6,7.3,7.6,7.1,6.3,6.5,6.4,6.4,7.3,7.8,7.5,6.9,6.6,6.3,6.7,7.7,7.9,7.6,7.1,7,6.9,6.5,6.9,7,6.6,6.6066
Arizona,6.4,6.45,6.5,6.55,6.6,6.2,10.1,8.8,5.2,6.3,6.9,6.5,6.4,5.3,5.3,5.9,7.5,6.4,6.1,5.3,5.6,4.6,4.3,4.4,4,4.8,6.1,5.7,5,4.7,4.2,3.9,6.2,9.9,10.4,9.5,8.3,7.7,6.8,6.1,5.4,4.9,4.8,4.8048
Arkansas,7.4,7.45,7.5,7.55,7.6,8.7,9.9,9.9,8.7,8.7,8.6,8.1,7.6,7,6.9,7.4,7.1,6.1,5.4,4.8,5.3,5.2,5.2,4.6,4.3,5,5.5,5.9,5.7,5.2,5.2,5.3,5.5,7.8,8.2,8.3,7.6,7.2,6,5,4,3.7,3.7,3.7037
California,6.6,6.65,6.7,6.75,6.8,7.4,10,9.8,7.8,7.2,6.7,5.8,5.3,5.1,5.8
@attila5287
attila5287 / const-permits.csv
Last active September 15, 2020 05:33
income for wage-salary merged data from BEA api routes
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 45 columns, instead of 7 in line 4.
name,1976,1977,1978,1979,1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019
Alabama,17104,23562,20953,17515,15909,9868,8691,17326,15308,17237,19180,14523,12773,12042,12525,11277,13905,16105,19136,20114,19868,17732,20533,19029,17406,17706,18403,22256,27411,30612,32034,25845,17464,13266,11261,11667,13506,11763,13507,14054,14623,14638,14653,14668
Alaska,5194,6912,4651,2661,2230,4514,8242,11248,6486,4029,1353,731,802,637,732,1047,1104,1657,2056,2164,2640,2560,2874,2211,2147,2939,3003,3531,3133,2885,2739,1706,901,916,904,877,994,1079,1387,1298,1215,1216,1217,1218
Arizona,23963,41913,62145,53752,36688,33395,36545,63964,79239,71820,61614,40181,32878,23820,23030,23521,31793,38656,51832,52714,53715,57762,63930,65109,61485,62496,66031,74996,90644,90851,65363,49642,26082,14474,12370,13007,21726,25209,26997,28910,30959,30990,31021,31052
Arkansas,8818,11294,9877,8464,8162,459
BasePriceLabel BedrmCt RegionID SizeRank RegionName StateName State Metro CountyName 1/31/2000 2/29/2000 3/31/2000 4/30/2000 5/31/2000 6/30/2000 7/31/2000 8/31/2000 9/30/2000 10/31/2000 11/30/2000 12/31/2000 1/31/2001 2/28/2001 3/31/2001 4/30/2001 5/31/2001 6/30/2001 7/31/2001 8/31/2001 9/30/2001 10/31/2001 11/30/2001 12/31/2001 1/31/2002 2/28/2002 3/31/2002 4/30/2002 5/31/2002 6/30/2002 7/31/2002 8/31/2002 9/30/2002 10/31/2002 11/30/2002 12/31/2002 1/31/2003 2/28/2003 3/31/2003 4/30/2003 5/31/2003 6/30/2003 7/31/2003 8/31/2003 9/30/2003 10/31/2003 11/30/2003 12/31/2003 1/31/2004 2/29/2004 3/31/2004 4/30/2004 5/31/2004 6/30/2004 7/31/2004 8/31/2004 9/30/2004 10/31/2004 11/30/2004 12/31/2004 1/31/2005 2/28/2005 3/31/2005 4/30/2005 5/31/2005 6/30/2005 7/31/2005 8/31/2005 9/30/2005 10/31/2005 11/30/2005 12/31/2005 1/31/2006 2/28/2006 3/31/2006 4/30/2006 5/31/2006 6/30/2006 7/31/2006 8/31/2006 9/30/2006 10/31/2006 11/30/2006 12/31/2006 1/31/2007 2/28/2007 3/31/2007 4/30/2007 5/31/2007 6/30/2007 7/31/2007 8/31/200
@attila5287
attila5287 / zhvi-dem0.csv
Created September 22, 2020 16:28
base price data set with round indexed columns instead of month-end-dated originals
BasePriceLabel BedrmCt RegionID SizeRank RegionName StateName State Metro CountyName Round1 Round2 Round3 Round4 Round5 Round6 Round7 Round8 Round9 Round10 Round11 Round12 Round13 Round14 Round15 Round16 Round17 Round18 Round19 Round20 Round21 Round22 Round23 Round24 Round25 Round26 Round27 Round28 Round29 Round30 Round31 Round32 Round33 Round34 Round35 Round36 Round37 Round38 Round39 Round40 Round41 Round42 Round43 Round44 Round45 Round46 Round47 Round48 Round49 Round50 Round51 Round52 Round53 Round54 Round55 Round56 Round57 Round58 Round59 Round60 Round61 Round62 Round63 Round64 Round65 Round66 Round67 Round68 Round69 Round70 Round71 Round72 Round73 Round74 Round75 Round76 Round77 Round78 Round79 Round80 Round81 Round82 Round83 Round84 Round85 Round86 Round87 Round88 Round89 Round90 Round91 Round92 Round93 Round94 Round95 Round96 Round97 Round98 Round99 Round100 Round101 Round102 Round103 Round104 Round105 Round106 Round107 Round108 Round109 Round110 Round111 Round112 Round113 Round114 Round115 Round116 Rou
@attila5287
attila5287 / colorado-cities.csv
Created October 2, 2020 04:07
city names of colorado extracted from zillow zhvi tables, will be used to generate random names
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
denver
colorado-springs
aurora
fort-collins
pueblo
lakewood
thornton
boulder
westminster
arvada
@attila5287
attila5287 / nick-names.csv
Last active May 26, 2021 15:50
list of nick names to upload to database in order to generate random player names along with colorado city names
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
luna
snake-eyes
sugar-boy
wuggle-bear
squishy
turtle
hop
lightning-ball
fruit-cake
gem