This is a cookiecutter project used to quickly create a FastAPI Python project. The project uses a "hypermodern" Python stack:
- Poetry
- Black
- Nox
- flake8
- mypy
- pytest
- Github actions
- Supports
Postgres
,MySQL
, andSQLite
back end databases.
- Install python3. The first article in the series linked above should get you started (he recommends
pyenv
). For example, if usingpyenv
, runpyenv local 3.9.2
(if using python v 3.9.2). - Install
poetry
; see the project homepage or this article. - Install cookiecutter 4 Run cookiecutter on this project, either cloning this repo locally and:
cookiecutter modern-python-fastapi-cookiecutter
or by running it via url:
cookiecutter https://github.com/lhayhurst/modern-python-fastapi-cookiecutter.git
You can then follow the instructions in the generated README.md
for building your running, running tests, and running the web server.
From a FASTApi perspective, the project ships with toy object model: a User
class, and a MicroBlogPost
class with a relationship back to the user.