跳转到主要内容

ProPublica Congress API的Python客户端

项目描述

A Python client for the ProPublica Congress API

安装

从PyPI安装

pip install python-congress

下载并运行安装脚本

git clone https://github.com/eyeseast/propublica-congress && cd propublica-congress
python setup.py install

使用方法

>>> 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

项目详情


下载文件

下载适用于您的平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源分发

python-congress-0.3.5.tar.gz (8.0 kB 查看哈希值)

上传时间:

构建分发

python_congress-0.3.5-py3-none-any.whl (9.5 kB 查看哈希值)

上传时间: Python 3

支持