Skip to content

vic3king/Politico-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

46 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Politico

Build Status Maintainability Test Coverage

Politico python version is a spin off of my initial project Politico. This Project rebuilds the backend application with new technologies.

Features

  • Users can sign up.
  • Users can login.
  • Admin can create political office
  • Admin can create political party
  • Authenticated users can query all parties
  • Authenticated users can query for a party
  • Authenticated users can query all offices
  • Authenticated users can query an office
  • Admin can delete a party

API Documentation

  • To view docs follow the setup steps for the application
  • visit localhost/politico on you browser
  • docs would be on the top right corner

Requirements and Installation

Via Cloning The Repository

# Clone the app
git clone https://github.com/vic3king/Politico-python.git

# Setup Env
Follow the format specified in the .env example

# Switch to directory
cd Politico-python

# Create virtual env(make sure you have birtualenv installed)
virtualenv --python=python3 venv

# Activate virtual env
source venv/bin/activate

# Install Package dependencies
 pip install -r requirements.txt

# create and setup .env file according to .env.exampl

# Run migrations
python manage.py db migrate
python manage.py db upgrade 

#Start the application
python3 manage.py runserver

#View the application
navigate to localhost:3000 to view the application

Testing

  • Running Tests
  • To run tests and observe test coverage for various versions of python . Run the command below.
tox
  • To run and check for test coverage. Run the command below:
pytest -v --cov
  • To obtain coverage report. Run the command below:
coverage report
  • To obtain html browser report. Run command below:
coverage html
A folder titled html_coverage_report will be generated. Open it and copy the path  of index.html and paste it in your browser.

Technologies

Backend

  • Python-Flask Flask is a microframework for Python based on Werkzeug, Jinja 2 and good intentions
  • GraphQl GraphQL is a new API standard that provides a more efficient, powerful and flexible alternative to REST.
  • SQLAlchemy SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL.
  • Alembic Alembic is a lightweight database migration tool for usage with the SQLAlchemy Database Toolkit for Python.

Linter(s)

  • pep8 - Linter Tool To run pep8 and ensure youre following the style guide
run flake8 --statistics

Pivotal Tracker

Project is currently being managed with Pivotal Tracker, a project management tool. You can find the stories on the politico Pivotal Tracker Board

Authors

  • Akaniru victory - Initial work - Vic3king if you've read this far... Leave a star โญ๏ธ

See also the list of contributors who participated in this project.

About

API hosted here ๐Ÿ‘‰๐Ÿฝ

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •