This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from bs4 import BeautifulSoup | |
import requests, os, subprocess | |
from time import sleep | |
download_dir = os.getcwd() | |
soup = BeautifulSoup(open('ned_links.html','rb')) | |
of = open('just_ned_links.txt', 'wb') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import requests, os, pickle, datetime, zipfile, subprocess, csv | |
from bs4 import BeautifulSoup | |
class FeedFetcher(): | |
def __init__(self, ddir=os.getcwd(), get_nj=True, nj_username='', nj_pass=''): | |
self.ddir = ddir | |
self.get_nj = get_nj # whether to fetch from NJ TRANSIT or not | |
self.tc = {} # time checks for GTFS fetches |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import csv | |
from math import cos, pi | |
# API key for Google Places | |
api_key= 'YOUR_KEY_GOES_HERE' | |
outf = open('njpoints.csv','w') | |
w = csv.writer(outf) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gviz_api | |
from django.db.models.query import ValuesQuerySet | |
# mapping of model field types to google vizualization column types (all not | |
# in list are 'string' type) valid google viz data types are: 'string' | |
# 'number' 'boolean' 'date' 'datetime' 'timeofday' | |
fieldmap = {'DateField':'date','DateTimeField':'datetime','BooleanField':'boolean', | |
'IntegerField':'number','DecimalField':'number','BigIntegerField':'number', | |
'FloatField':'number','TimeField':'timeofday','NullBooleanField':'boolean'} |
NewerOlder