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.

Source Distribution

pyopenfec-0.2.5.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

pyopenfec-0.2.5-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file pyopenfec-0.2.5.tar.gz.

File metadata

  • Download URL: pyopenfec-0.2.5.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.17 CPython/3.7.2 Linux/5.3.0-19-generic

File hashes

Hashes for pyopenfec-0.2.5.tar.gz
Algorithm Hash digest
SHA256 ec4d76451b4314203c1981777197e820e32296fec5aa34a7d8e610929f3dbb9d
MD5 56a9cb1ae809150e6a27611035a737ed
BLAKE2b-256 acdfe470ed7fbc8fb375926199b80c1565232c326d1e33ffb4f504b4427301dd

See more details on using hashes here.

File details

Details for the file pyopenfec-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: pyopenfec-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.17 CPython/3.7.2 Linux/5.3.0-19-generic

File hashes

Hashes for pyopenfec-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5c9818e2f915f88b7a4854ee4239a3c85bcb2cd806dfa51ba52fb2a671107e5f
MD5 a1c2b38fefb4c48d4481d0b236026a03
BLAKE2b-256 9c0bde74a09f597ea04c53d1915d6635c8f70842cd076255d58624bc8be2aded

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