Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andredias/cookiecutter-fastapi
https://github.com/andredias/cookiecutter-fastapi
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/andredias/cookiecutter-fastapi
- Owner: andredias
- License: mit
- Created: 2021-06-01T12:41:35.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-09-30T23:05:57.000Z (almost 3 years ago)
- Last Synced: 2024-06-02T06:35:20.315Z (4 months ago)
- Language: HTML
- Size: 522 KB
- Stars: 12
- Watchers: 3
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
Cookiecutter FastAPI
====================This template generator creates a FastAPI application for a REST API.
Features
--------* Python 3.9+ (configurable)
* Poetry_ based dependency management
* FastAPI_
* Correct `ASGI Lifespan`_ events management for FastAPI
* Session management, login/logout
* Cache using Redis (aioredis)
* Postgres asynchronous database access based on `Encode Databases`_
* Docker image for deployment based on multi-stage builds
* Development tasks registered in a ``Makefile`` for easy access and management
* Mercurial/Git hooks for ``pre-commit`` and ``pre-push`` events
* Linting based on flake8_ (and plugins), blue_, mypy_ and isort_
* Asynchronous tests based on pytest_, httpx_ and alt-pytest-asyncio_Instructions
============You must have cookiecutter_ installed::
$ pip install --user cookiecutter
Usage
=====You can use this template directly from its repository::
$ cookiecutter https://github.com/andredias/cookiecutter-fastapi.git
You will be prompted to enter a bunch of project config values.
Then,
Cookiecutter will generate a project from the template,
using the values that you entered.That's it!
Similar Projects
================There are a few `templates and generators for FastAPI projects`_.
All of them have their own opinionated group of implementation choices.
Since I couldn't find any who met my needs or design preferences,
I decided to create one of my own... _alt-pytest-asyncio: https://pypi.org/project/alt-pytest-asyncio/
.. _ASGI Lifespan: https://pypi.org/project/asgi-lifespan/
.. _blue: https://pypi.org/project/blue/
.. _cookiecutter: https://github.com/cookiecutter/cookiecutter
.. _Encode Databases: https://www.encode.io/databases/
.. _FastAPI: https://fastapi.tiangolo.com/
.. _flake8: https://pypi.org/project/flake8/
.. _httpx: https://www.python-httpx.org/
.. _isort: https://pypi.org/project/isort/
.. _mypy: http://mypy-lang.org/
.. _Poetry: https://python-poetry.org/
.. _pytest: https://pytest.org
.. _templates and generators for FastAPI projects: https://github.com/mjhea0/awesome-fastapi#boilerplate