Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eyeseast/propublica-congress
A Python client for the ProPublica Congress API
https://github.com/eyeseast/propublica-congress
api api-client congress government politics python
Last synced: 13 days ago
JSON representation
A Python client for the ProPublica Congress API
- Host: GitHub
- URL: https://github.com/eyeseast/propublica-congress
- Owner: eyeseast
- License: mit
- Created: 2017-02-04T16:30:48.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-07-16T14:32:56.000Z (over 4 years ago)
- Last Synced: 2024-10-14T12:48:58.081Z (about 1 month ago)
- Topics: api, api-client, congress, government, politics, python
- Language: Python
- Homepage: https://propublica-congress.readthedocs.io/en/latest/
- Size: 72.3 KB
- Stars: 53
- Watchers: 5
- Forks: 19
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Python Congress
==================A Python client for the ProPublica [Congress API](https://projects.propublica.org/api-docs/congress-api/)
Install
-------From PyPI:
pip install python-congress
Download and run the install script:
git clone https://github.com/eyeseast/propublica-congress && cd propublica-congress
python setup.py installUsage
----->>> from congress import Congress
>>> congress = Congress(API_KEY)
# get member by bioguide ID
>>> pelosi = congress.members.get('P000197')
>>> pelosi['twitter_id']
'NancyPelosi'
# get recent House bills
# recent bills come in two types: 'introduced' and 'updated'
>>> introd = congress.bills.recent(chamber='house', congress=111, type='introduced')
>>> len(introd['bills'])
20
>>> introd['chamber']
'House'
# or use a convenience function
>>> introd = congress.bills.introduced('house')
>>> introd['chamber']
'House'
>>> len(introd['bills'])
20