Skip to content

A Sample Python API with Pipenv, Flask, Flask RESTPlus, and PyTest

Notifications You must be signed in to change notification settings

nikolayg/sample-python-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

This is a simple Python API boilderplate using Flask and Flask-RESTPlus. It uses Pyenv and Pipenv for runtime and package management. It also uses pytest and pytest-flask for unit testing.

You can find detailed documentation on this boilerplate's set-up here.

Set Up

Install Pyenv following the official installation instructions.

Download the proper python version:

# Installs the version from ".python-version" if not installed 
# Can take some time.
pyenv install

Install pipenv:

pip install --user pipenv

Install all dependencies

pipenv install

Run locally

# If you haven't already, then start a pipenv shell
pipenv shell

PYTHON_ENV=development python src/main.py

Visit Swagger UI on http://localhost:5000/api/swagger.

Run unit tests

# If you haven't already, then start a pipenv shell
pipenv shell

python -m pytest

About

A Sample Python API with Pipenv, Flask, Flask RESTPlus, and PyTest

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages