Microsoft Excel can be a powerful tool for analyzing FEC filings. This library (hopefully) makes it easy to create multi-sheet Excel files from files in the .fec file format, with a sheet for the summary data and a sheet for each type of itemization.
Usage
Note: this library works best with version 3.7+ of Python due to the ordering of dictionary keys being guaranteed to be in insertion order. The library should still work in older version of Python, but the columns on each sheet might be in a nonsensical order.
First, install from PyPi:
pip install fec2xlsx
Then, call one of the two methods for generating Excel files:
import fec2xlsx
fec2xlsx.file_number_xlsx(1326061, 'Gillibrand_Q1.xlsx')
fec2xlsx.file_location_xlsx('/path/to/1326016.fec', 'Harris_Q1.xlsx')
The file_number_xlsx method requests the specified file_number via http from the FEC's server's, first trying the URL for digital filings, then trying the URL for paper filings if the first response returns a 404 status code.
The file_location_xlsx method reads from the specified file_path (which takes anything you might pass to Python's open method) then writes to the specified filename output.
Both methods take an optional options keyword argument.
Options
-
filter_memo_x: (default:True) if True, ignores rows that have "X" as theirmemo_code. If, for example, a contribution comes in through a conduit committee like ActBlue, there are two rows: one for the contribution from an individual to the conduit and one from the conduit to the committee filing the report. Generally the second of those rows is marked with an "X" in thememo_codefield and is the less useful of the two. -
money_format: (default:$#,##0.00) The format used for displaying monetary values. See here for more details/documentation. -
date_format: (default:d mmm yyyy) The format used for displaying date values. See here for more details/documentation.
Metadata
Release files for fec2xlsx 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| fec2xlsx-0.1.2.tar.gz | 3.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fec2xlsx-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.0 kB
Release files / fec2xlsx-0.1.2.tar.gz
| Download URL | fec2xlsx-0.1.2.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1096273278acd16c7ca442e82cf5d129c03b4be89c95ad7182baea4d0c74886d
|
|
BLAKE2b-256 checksum How to use checksums |
ec11c0191a09839acbfbcbaeac2b9f1cdf548e39e745bd6220b390f2e41173d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
|
Release files / fec2xlsx-0.1.2-py3-none-any.whl
| Download URL | fec2xlsx-0.1.2-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f8d79555c08dec9b491ce7d6109f4a3b8188ff51ae12ad9f76a79c8403713ded
|
|
BLAKE2b-256 checksum How to use checksums |
af62345462e9028375813f998c723fe152189a0548c4e869913869282eb7362c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
|
Security for fec2xlsx 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.