Last active
December 26, 2015 15:49
-
-
Save cclauss/7174999 to your computer and use it in GitHub Desktop.
earthQuakes - A starter experiment with Socrata Open Data
This file contains hidden or 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 json, requests | |
minMagnitude = str(5) | |
theURL = 'https://soda.demo.socrata.com/resource/earthquakes.json?%24where=magnitude%20%3E%20' + minMagnitude | |
fmt = '{datetime} {earthquake_id} {version} {magnitude} {depth:>6} {location[latitude]:>8} {location[longitude]:>8} {region}' | |
for theQuake in json.loads(requests.get(theURL).text): | |
print(fmt.format(**theQuake)) | |
print('=' * 75) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment