8000 GitHub - dominis/parlament-api-client: A very simple python client for the Hungarian Parliament's api
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

dominis/parlament-api-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

parlament-api-client

A very simple python client for the Hungarian Parliament's API

You can obtain an access token at: http://www.parlament.hu/w-api-tajekoztato

API documentation: http://parlament.hu/documents/10181/122580/webapi_felhasznaloi_kezikonyv.pdf/ecd95564-d32d-4b84-9748-89c4833ea10d

Getting started

pip -r install requirements.txt

Install

pip install git+https://github.com/dominis/parlament-api-client.git#egg=parlament-api-client

Usage

Simple example

from papi import PAPI

c = PAPI(token='YOUR-TOKEN')

kepviselo = c.kepviselo(p_azon='z004')
print kepviselo['nev']

for item in kepviselo['kepvcsop-tagsagok']['tagsag']:
     print '%s -> %s' % (item['@ciklus'], item['@kepvcsop'])

Debug mode

from papi import PAPI

c = PAPI(token='YOUR-TOKEN', debug=True)

kepviselo = c.kepviselo(p_azon='z004')

Redis cache

sudo pip install redis
import papi

c = papi.PAPI(token='YOUR-TOKEN', debug=True, cache=papi.RedisCache())

for i in range(0,100):
    c.kepviselo(p_azon='z004')

About

A very simple python client for the Hungarian Parliament's api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0