Skip to content

Instantly share code, notes, and snippets.

@lmeulen
Created April 3, 2021 11:48
Show Gist options
  • Save lmeulen/760df897f1e5b0a51bb23bc50b2ef529 to your computer and use it in GitHub Desktop.
Save lmeulen/760df897f1e5b0a51bb23bc50b2ef529 to your computer and use it in GitHub Desktop.
crowdedness_download_gtfs
if not os.path.exists(os.path.join(GTFSDIR,'gtfs-nl.zip')):
url = 'http://gtfs.ovapi.nl/nl/gtfs-nl.zip'
with requests.get(url, stream=True) as r:
r.raise_for_status()
with open(os.path.join(GTFSDIR,'gtfs-nl.zip'), 'wb') as f:
for chunk in r.iter_content(chunk_size=1073741824):
f.write(chunk)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment