Created
September 17, 2013 21:00
-
-
Save gnrfan/6600563 to your computer and use it in GitHub Desktop.
Un ejemplo sencillo de como acceder de forma programática, usando Python. a los datos de la Municipalidad de Lima. Más información en http://lima.datosabiertos.pe/
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 | |
# | |
# This is a demo script on how to use the Junar API provided by http://lima.datosabiertos.pe/ | |
# More info un Junar APIs here: http://wiki.junar.com/index.php/API | |
# | |
# Steps to install the Junar API client in a virtual environment: | |
# | |
# virtualenv --no-site-packages env | |
# source env/bin/activate | |
# pip install git+git://github.com/Junar/junar-api-python-client.git | |
# | |
# You can obtain an API Key without registering from this URL: | |
# http://lima.datosabiertos.pe/developers/ | |
import json | |
from junar import ApiClient | |
MUNILIMA_JUNAR_API_KEY = '<paste your Junar API key here>' | |
MUNILIMA_DATASET_GUID = 'MUSEO-DE-LIMA' | |
junar_api_client = ApiClient(MUNILIMA_JUNAR_API_KEY) | |
datastream = junar_api_client.datastream(MUNILIMA_DATASET_GUID) | |
print json.dumps(datastream.invoke(output = 'json_array'), indent=4) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment