https://dl.pstmn.io/download/latest/linux64
- A client will be able to add a user
- A client will be able to update a user
- A client will be able to delete a user
- A client will be able to get a user
- A client will be able to get all user
- A client will be able to add a party
- A client will be able to update a party
- A client will be able to delete a party
- A client will be able to get a party
- A client will be able to get all parties
- A client will be able to add a political seat/office
- A client will be able to update a political seat/office
- A client will be able to delete a political seat/office
- A client will be able to get a political seat/office
- A client will be able to get all political seat/office
- A client will be able to add a candidate
- A client will be able to vote
- A client will be able to petition
- A client will be able to view election results
step 1
Clone the repository using the following command
git clone https://github.com/erycoking/Politico_API.git
Change directrory to Politico_API using the following command
cd Politico_API
Create and activate a virtual environment
virtualenv venv
source venv/bin/activate
Install project dependencies
pip install -r requirements.txt
step 2
python run.py
step 3
pytest
METHOD | ENDPOINT | FUNCTIONALITY |
---|---|---|
GET | /users | Gets all users |
GET | /users/int:id | Gets a single user |
POST | /users | Adds a user |
PATCH | /users | Updates a user |
DELETE | /users/int:id | Deletes a user |
METHOD | ENDPOINT | FUNCTIONALITY |
---|---|---|
GET | /parties | Gets all parties |
GET | /parties/int:id | Gets a single party |
POST | /parties | Adds a party |
PATCH | /parties | Updates a party |
DELETE | /parties/int:id | Deletes a party |
METHOD | ENDPOINT | FUNCTIONALITY |
---|---|---|
GET | /offices | Gets all offices |
GET | /offices/int:id | Gets a single office |
POST | /offices | Adds a office |
PATCH | /offices | Updates a office |
DELETE | /offices/int:id | Deletes a office |
METHOD | ENDPOINT | FUNCTIONALITY |
---|---|---|
GET | /candidates | Gets all Candidates |
GET | /candidates/int:id | Gets a single Candidate |
POST | /candidates | Adds a Candidate |
PATCH | /candidates | Updates a Candidate |
DELETE | /candidates/int:id | Deletes a Candidate |
METHOD | ENDPOINT | FUNCTIONALITY |
---|---|---|
POST | /auth/signup | User Sign up |
POST | /auth/login | User Login |
METHOD | ENDPOINT | FUNCTIONALITY |
---|---|---|
GET | /users | Gets all users |
GET | /users/int:id | Gets a single user |
PATCH | /users | Updates a user |
DELETE | /users/int:id | Deletes a user |
METHOD | ENDPOINT | FUNCTIONALITY |
---|---|---|
GET | /parties | Gets all parties |
GET | /parties/int:id | Gets a single party |
POST | /parties | Adds a party |
PATCH | /parties | Updates a party |
DELETE | /parties/int:id | Deletes a party |
METHOD | ENDPOINT | FUNCTIONALITY |
---|---|---|
GET | /offices | Gets all offices |
GET | /offices/int:id | Gets a single office |
POST | /offices | Adds a office |
PATCH | /offices | Updates a office |
DELETE | /offices/int:id | Deletes a office |
METHOD | ENDPOINT | FUNCTIONALITY |
---|---|---|
GET | /office/int:id/candidates | Gets all Candidates belonging to a particular office |
GET | /office/int:id/candidates/int:id | Gets a single Candidate belonging to a particular office |
POST | /office/int:id/register | Adds a Candidate to a particular office |
PATCH | /office/int:id/candidates | Updates a Candidate belonging to a particular office |
DELETE | /office/int:id/candidates/int:id | Deletes a Candidate belonging to a particular office |
METHOD | ENDPOINT | FUNCTIONALITY |
---|---|---|
GET | /votes | Gets all votes |
GET | /offices/int:id/result | Gets votes for a single office |
POST | /votes | Cast a votes |
METHOD | ENDPOINT | FUNCTIONALITY |
---|---|---|
GET | /petitions | Gets all petitions |
GET | /petitions/int:id | Gets a single petition |
POST | /petitions | Adds a petition |
PATCH | /petitions | Updates a petition |
DELETE | /petitions/int:id | Deletes a petition |