skip to navigation
skip to content

tx_tecreports 1.1.0

Package for dealing with TEC reports

Python code for interacting with Texas Ethics Commission reports


This does not account for all of the variations in all reports (yet). This message will stay here until it does.

Installation & Configuration

You can install this using pip like this:

pip install tx_tecreports

Now you’re ready to start using tx_tecreports.


tx_tecreports parses campaign finance reports from the Texas Ethics Commission. You use the tx_tecreports.fetcher.get_report like this.

>>> from tx_tecreports.fetcher import get_report

You can fetch any report so long as you have the correct ID. For example, you could grab Wendy Davis’ first special session report (the first one filed after her filibuster) with the ID 581606. You can find that ID by visiting her filer page on the Texas Ethics Commission website.

>>> report = get_report(581606)

Now you can interact with the various data in the cover element via report.cover.

>>> report.cover.type_of_filing
>>> report.cover.is_original
>>> report.cover.through_date - report.cover.from_date

You can verify that this is her personal filing by seeing that the filer_type is a IND:

>>> report.cover.filer.filer_type

The really interesting data is in the receipts property, a list of all of the contributions received in this report. For example, you can see how many contributions where made by looking at its length:

>>> len(report.receipts)

You can create a list of all of the contributions on any given day with by looking at the like this:

>>> len([a for a in report.receipts if == report.cover.from_date])

Oops, looks like she didn’t have any contributions on the first day of that report. Let’s change it to the last day:

>>> len([a for a in report.receipts if == report.cover.through_date])

That’s more like it!

TODO: Flesh out this example as part of the narrative text

>>> from tx_tecreports.fetcher import get_filings_list
>>> filings = get_filings_list("00062095COH")
>>> len(filings) >= 33  # Has 33 filings as of January 2014
>>> report = filings[-1].report
>>> len(report.receipts)
>>> report.total_receipts
File Type Py Version Uploaded on Size
tx_tecreports-1.1.0.tar.gz (md5) Source 2014-02-27 120KB