TEC报告处理包

tx_tecreports的Python项目详细描述


Texas Ethics Commission报表交互的python代码

注意

这还不能解释所有报告中的所有变化。 此消息将一直保留到收到为止。

安装和配置

您可以使用pip这样安装:

pip install tx_tecreports

现在您可以开始使用tx_tecreports

用法

tx_tecreportsTexas Ethics Commission。使用tx_tecreports.fetcher.get_report 这样地。

>>>fromtx_tecreports.fetcherimportget_report

只要你有正确的身份证,你就可以取任何报告 你可以拿温迪·戴维斯的第一份特别会议报告 (第一个是在她的阻挠之后提交的)身份是581606。 你可以通过访问 Texas Ethics Commission网站

>>>report=get_report(581606)

现在您可以通过 report.cover

>>>report.cover.type_of_filingu'COH-SS'>>>report.cover.is_originalTrue>>>report.cover.through_date-report.cover.from_datedatetime.timedelta(29)

你可以看到这是她的个人档案 文件管理器类型是:

>>>report.cover.filer.filer_typeu'IND'

真正有趣的数据在receipts属性中,一个列表 在本报告收到的所有捐款中。例如, 您可以通过查看它的 长度:

>>>len(report.receipts)1240

您可以创建任何给定日期的所有供款列表 通过这样看contribution.date

>>>len([aforainreport.receiptsifa.contribution.date==report.cover.from_date])0

哦,看来她第一天就没有稿件了 关于那份报告我们改到最后一天:

>>>len([aforainreport.receiptsifa.contribution.date==report.cover.through_date])1187

更像是这样!

todo:将此示例充实为叙述文本的一部分

>>>fromtx_tecreports.fetcherimportget_filings_list>>>filings=get_filings_list("00062095COH")>>>len(filings)>=33# Has 33 filings as of January 2014True>>>report=filings[-1].report>>>len(report.receipts)157>>>report.total_receipts279284.94

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
使用SerializationUtils时java ClassNotFoundException。克隆()   java Cucumber+spring:如何通过测试触发SmartLifecycle事件?   java如何使ProGuard以简单的方式工作?   java JSP页面显示来自集合的日期   谷歌地图检查坐标是否位于JAVA中谷歌地图API的多边形中   java如何在终端中使用“tokens”打印令牌?   java获取编译错误:包com。威里奥。sdk不存在   java会使用JAXB或类似工具自动填充HATEAOS链接吗?   Javascript(GraalJS)与Java中未签名的右移>>>>   如何在Java代码中创建jdbc请求的Jmeter测试   java如何在CellList中添加或删除单个元素?   java Progressbar:如何创建原始对象的深度副本