Skip to main content

# FEC API wrapper

by Jake Kara jkara@trendct.org

#### Example 1: Quickstart

>>> from fec import Fec
>>> conn = Fec(YOUR_API_KEY)
>>> ret = conn.get("/candidates")
>>> print ret

#### Example 2: Optionals

ret = conn.get(“/candidates”,

pages=[1,2,3,4,5], # Specify which pages to retrieve params=”&cycle=2012&cycle=2016&office=P”) #Specify parameters

#### Unstable code warning!

At the moment I don’t have plans to develop this into a stable and backwards compatible code base. I haven’t added a lot of conveniences likehard-coding queries you can make. I’m publishing this code in case someone else finds it useful to see how to build a quick API wrapper.

Here are some features I do plan to add:

1. A parameter-forming method so you don’t have to pass all the URL parameters in one mashed-up string.

  1. A method to get all pages of results

3. Rate limit-friendliness? Maybe I’ll make this prevent you from running over API rate limits. Maybe not.

  1. Maybe I will add convenience methods for common queries.

Metadata

Release files for fec 0.0

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

Source distribution (sdist)

Source distribution for fec 0.0
File Size Uploaded Provenance Actions
fec-0.0.tar.gz 1.1 kB Without provenance Details for fec-0.0.tar.gz

Release files / fec-0.0.tar.gz

Download URL fec-0.0.tar.gz
Size 1.1 kB
Tags Source
SHA-256 checksum
How to use checksums
8b8c652077eff012f09ce652aa6b0ea15fba0e813328566c8f8fd2dd3e431490
BLAKE2b-256 checksum
How to use checksums
2ad0694a9c27731d7afd194281aaafb2ac5bb260f6149892479c385dd7aaf28f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for fec 0.0

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.

Release history Release notifications | RSS feed

This release

0.0 This release

1 release file No provenance

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