Skip to main content

Simple FEC API wrapper

Project description

# 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.

Project details


Release history Release notifications | RSS feed

This version

0.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fec-0.0.tar.gz (1.1 kB view details)

Uploaded Source

File details

Details for the file fec-0.0.tar.gz.

File metadata

  • Download URL: fec-0.0.tar.gz
  • Upload date:
  • Size: 1.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for fec-0.0.tar.gz
Algorithm Hash digest
SHA256 8b8c652077eff012f09ce652aa6b0ea15fba0e813328566c8f8fd2dd3e431490
MD5 4ae728b29fe5b2381153e4048a7df62c
BLAKE2b-256 2ad0694a9c27731d7afd194281aaafb2ac5bb260f6149892479c385dd7aaf28f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page