Skip to content

Instantly share code, notes, and snippets.

@cclauss
Last active December 26, 2015 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cclauss/7174999 to your computer and use it in GitHub Desktop.
Save cclauss/7174999 to your computer and use it in GitHub Desktop.
earthQuakes - A starter experiment with Socrata Open Data
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