Async template on FastAPI and SQLAlchemy 1.4
Description
Production-ready dockerized async REST API on FastAPI with SQLAlchemy and PostgreSQL
Key Features
- tests on
pytest
with automatic rollback after each test case - db session stored in Python's
context variable
- configs for
mypy
,pylint
,isort
andblack
Alembic
for DB migrations- CI with Github
git clone
run
After task -l # list of tasks with descriptions
Prepare virtual environment
python3 -m venv venv
source venv/bin/activate
poetry install
Poetry
Poetry is python package manager.
Poetry resolve dependencies and conflicts in package and make it fast.
Basic usage
poetry lock
lock dependenciespoetry update
lock, update and install dependenciespoetry install
for install dependencies from pyproject.tomlpoetry add <package>
for adding dependency with check on conflictspoetry remove <package>
for removepoetry self update
update poetry
Task
Task is a task runner / build tool that aims to be simpler and easier to use than, for example, GNU Make.
Basic usage
task -l
- list of tasks with descriptionstask -a
- list of all tasks