Metadata-Version: 2.1
Name: pyopenfec
Version: 0.2.5
Summary: OpenFEC API Client
Home-page: https://github.com/jeremyjbowers/pyopenfec
License: MIT
Keywords: fec,campaign,finance,openfec
Author: Jeremy Bowers
Author-email: jeremyjbowers@gmail.com
Requires-Python: >=3.5,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Requires-Dist: pytz (>=2019.3,<2020.0)
Requires-Dist: requests (>=2.22,<3.0)
Project-URL: Repository, https://github.com/jeremyjbowers/pyopenfec
Description-Content-Type: text/markdown

# PyOpenFec
A Python wrapper for the OpenFEC API. Documentation for this API can be found [here](https://api.open.fec.gov/developers)

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

