Skip to main content

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() and candidates() methods

  • committee: use the committee() and committees() 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!

Release files for opynfec 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for opynfec 0.0.4
File Size Uploaded
opynfec-0.0.4.tar.gz 7.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for opynfec 0.0.4
File Interpreter ABI Platform
opynfec-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 14.2 kB

Release files / opynfec-0.0.4.tar.gz

Download URL opynfec-0.0.4.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2fedd488743836170971042de6768e9343f9a3ef9fc83cb91f41936ae22fecd6
BLAKE2b-256 checksum
How to use checksums
6290408a6909bd3744fd0fed096f27dd2888a4e719db485d7d7e24636b0482e3
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / opynfec-0.0.4-py3-none-any.whl

Download URL opynfec-0.0.4-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c9a1618ff96c6bff6951848c5f1ff36b0ada863242fb23fdcea4757bc4192a03
BLAKE2b-256 checksum
How to use checksums
158b94c86f1492fbb339d4511d43b210637c4610af7b60628e5f8d2aa0e378bb
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page