A wrapper for the openFEC API
Project description
opynfec
Python wrapper for OpenFEC API
This product uses the openFEC API but is not endorsed or certified by the Federal Election Commission (FEC).
Setup
Download
Download the package via pip with the command
>>> pip install opynfec
Get API Key
For small-scale testing, you can use "DEMO_KEY" as your API key, but for higher rate limits, create your own personalized key with the FEC at: https://api.open.fec.gov/developers/.
Basic Example
First, create you API connection object:
>>> from opynfec import OpynFEC
>>> api = OpynFEC("DEMO_KEY") # Replace with you own key if you have it
Now you can use any of the implemented endpoints. For example, you can search for basic info about President Biden from all of the candidates that have registered with the FEC:
>>> api.search("biden", category="candidates")
[{'name': 'OBAMA, BARACK / JOSEPH R. BIDEN', 'id': 'P80003338', 'office_sought': 'P'}, {'name': 'BIDEN, JOSEPH R JR', 'id': 'P80000722', 'office_sought': 'P'}, ...]
See below for an overview of all of the endpoints that have been implemented.
What has been implemented?
Below we go through each category (in the same way the openFEC does in their documentation) and describe the status of each.
-
candidate: use the
candidate()andcandidates()methods -
committee: use the
committee()andcommittees()methods -
dates: not implemented
-
financial: use the
financial()method -
search: use the
search()method -
filings: not implemented
-
receipts: use the
receipts()method -
disbursements: use the
disbursements()method -
loans: not implemented
-
debts: not implemented
-
independent expenditures: not implemented
-
party-coordinated expenditures: not implemented
-
communication cost: not implemented
-
electioneering: not implemented
-
presidential: not implemented
-
filer resources: not implemented
-
efiling: not implemented
-
audit: not implemented
-
legal: not implemented
More work will continue to be done, and contributions are always welcome!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file opynfec-0.0.4.tar.gz.
File metadata
- Download URL: opynfec-0.0.4.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2fedd488743836170971042de6768e9343f9a3ef9fc83cb91f41936ae22fecd6
|
|
| MD5 |
309a539520d9e901e6651b25d47a7123
|
|
| BLAKE2b-256 |
6290408a6909bd3744fd0fed096f27dd2888a4e719db485d7d7e24636b0482e3
|
File details
Details for the file opynfec-0.0.4-py3-none-any.whl.
File metadata
- Download URL: opynfec-0.0.4-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9a1618ff96c6bff6951848c5f1ff36b0ada863242fb23fdcea4757bc4192a03
|
|
| MD5 |
566b4d13e0ef827b85cc211a7cbe99d8
|
|
| BLAKE2b-256 |
158b94c86f1492fbb339d4511d43b210637c4610af7b60628e5f8d2aa0e378bb
|