Politico is a government-like voting system. It allows for candidates to vie under political parties and allows for regular users to vote.
This API allows for exposure of the data held by POLITICO. This reference guide shows you how you can be able to access the data inside the POLITICO system online. Our frontend
NOTE This setup guide assumes you have python and virtualenv installed in your system.
virtualenv venv
On linux
source venv/bin/activate
On Windows:
venv\Scripts\activate
All of the requirements will be installed through the requirements.txt file. Run the following command to install:
pip install -r requirements.txt
To run the flask application, write the following command:
python run.py
The tests are contained in the politico_api/tests/ folder. The tests can be run using the following command:
pytest politico/tests/
To get the coverage of the tests, run:
pytest --cov=.
VERSION 1 Hosting
route | method | function | JSON fields |
---|---|---|---|
/api/v1/offices/ | POST | create a new office | "office_name": string, "office_type": string |
/api/v1/offices/ | GET | get all offices | No json fields |
/api/v1/offices/officeID | GET | gets a single office information | no json fields |
/api/v1/parties/ | GET | gets all parties | no json field |
/api/v1/parties/partyID/partyName | PATCH | edits a single party with ID partyID and sets its name to partyName | no json field |
/parties/partyID | DELETE | deletes the party with ID partyID | no json field |
/parties/partyID | GET | gets a single party with ID partyID | no json field |
/parties/ | POST | creates a party | "party_name": string, "party_name": string, "party_hq_address": string, "party_logo_url": str, "party_motto": str, "party_members": int |
VERSION 2