Exemple #1
0
from junar import ApiClient

if __name__ == '__main__':
    # display dates related to proposed law at Chilean senado
    guid = 'CONGR-DE-LA-PROYE-PUBLI'

    # get an auth_key at www.junar.com/developers/
    auth_key = 'yourauthkeyhere'
    junar_api_client = ApiClient(auth_key)

    # the guid (identificator)
    datastream = junar_api_client.datastream(guid)

    # the parameters are the date in chilean format
    response = datastream.invoke(params=['01/01/2011', '01/12/2011'],
                                 output='json_array')
    result = response['result']

    # iterating the response and printing it
    for row in result:
        print '%s -> %s' % (row[4], row[1])
Exemple #2
0
from junar import ApiClient

junar_api_client = ApiClient('yourauthkey')
datastream = junar_api_client.datastream('CURRE-AGAIN-USD-FULL-LIST')
response = datastream.invoke(output='prettyjson')
for row in response['result']:
    print row

response = datastream.invoke(output='xml')
print response
#!/usr/bin/env python
# -*- coding: utf-8 -*- 

from junar import ApiClient

from functions import production, product_source, region_products, \
product_region_percentages
from parameters import GUID, AUTH_KEY, fields

junar_api_client = ApiClient(AUTH_KEY)
datastream = junar_api_client.datastream(GUID)
data = datastream.invoke(output = 'json_array')

#print production(data['result'][1:], '2008', 'MAR', 'ANCASH', '0201')
#print product_source(data['result'][1:], '0201')
#print region_products(data['result'][1:], 'AREQUIPA')
print  product_region_percentages(data['result'][1:], '2012', '3802')