Skip to content

Instantly share code, notes, and snippets.

@oeon
Forked from bmcbride/fulcrum_download.py
Last active May 11, 2016 17:54
Show Gist options
  • Save oeon/57b8d8d0859336424ff7235dc0772020 to your computer and use it in GitHub Desktop.
Save oeon/57b8d8d0859336424ff7235dc0772020 to your computer and use it in GitHub Desktop.
Python script for fetching a Fulcrum data share and saving it locally with a date & time stamp.
import urllib2
import datetime
def timeStamped(fname, fmt='%Y-%m-%d-%H-%M-%S_{fname}'):
return datetime.datetime.now().strftime(fmt).format(fname=fname)
url = 'https://web.fulcrumapp.com/shares/6e158acd08cacfad.csv'
u = urllib2.urlopen(url)
localFile = open('fulcrum_data.csv', 'w')
localFile.write(u.read())
localFile.close()
with open(timeStamped('fulcrum_data.csv'),'w') as outf:
outf.write('data!')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment