Skip to main content

OpenFEC API Client

Project description

PyOpenFec

A Python wrapper for the OpenFEC API. Documentation for this API can be found here

Installation

pip install pyopenfec

Examples

Candidates

Candidate

The Candidate class holds fields for each candidate in the OpenFEC API.

A number of class and instance methods are available.

count

The Candidate.count() method will return the number of Candidate objects available for a given query. Note: This method returns an integer representing the number of items available in the OpenFEC API. It does not return a list of objects.

from pyopenfec import Candidate
candidate_count = Candidate.count(cycle=2016, office="P", candidate_status="C")

fetch

The Candidate.fetch() method will return a list of Candidate objects available for a given query. This method will automatically page through the results and return all objects available in the OpenFEC API.

from pyopenfec import Candidate
candidate_count = Candidate.count(cycle=2016, office="P", candidate_status="C")
candidates = Candidate.fetch(cycle=2016, office="P", candidate_status="C")
for candidate in candidates:
    print("{name}, {party}".format(name=candidate.name, party=candidate.party))

Committees

tktk

Reports

tktk

Project details


Download files

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

Files for pyopenfec, version 0.2.5
Filename, size File type Python version Upload date Hashes
Filename, size pyopenfec-0.2.5-py3-none-any.whl (12.1 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size pyopenfec-0.2.5.tar.gz (9.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page