Retour au classement

s3rius/FastAPI-template

Python

Feature rich robust FastAPI template.

fastapicookiecuttercookiecutter-templatecookiecutter-python3sqlalchemy-ormasynchronousormartortoise-ormaerichalembicpython3asyncio
Croissance des étoiles
Étoiles
2.8k
Forks
240
Croissance hebdomadaire
Issues
37
1k2k
oct. 2020sept. 2022août 2024juil. 2026
ArtefactsPyPIpip install fastapi-template
README

version downloads

Flexible general-purpose template for FastAPI.

Usage

⚠️ Git, Python and UV must be installed and accessible ⚠️

Templator in action

You can install it directly from pypi with pip.

python3 -m pip install fastapi_template
python3 -m fastapi_template
# or fastapi_template
# Answer all the questions
# 🍪 Enjoy your new project 🍪
cd new_project
docker-compose up --build

If you want to install it from sources, try this:

python3 -m pip install uv 
python3 -m pip install .
python3 -m fastapi_template

Also, you can use it with docker.

docker run --rm -it -v "$(pwd):/projects" ghcr.io/s3rius/fastapi_template

Features

One of the coolest features is that this project is extremely configurable. You can choose between different databases and even ORMs, or you can even generate a project without a database! Currently SQLAlchemy 2.0, TortoiseORM, Piccolo, Ormar and Beanie are supported.

This project can run as TUI or CLI and has excellent code documentation.

Generator features:

  • Pydantic V2 (Where it's possible. Some libs doesn't have support);
  • You can choose between GraphQL and REST api;
  • Uvicorn and gunicorn;
  • Different databases support;
  • Different ORMs support;
  • Optional migrations for each ORM except raw drivers;
  • Optional redis support;
  • Optional rabbitmq support;
  • different CI\CD;
  • Optional Demo routers and models (This helps you to see how project is structured);
  • Pre-commit integration;
  • Generated tests with almost 90% coverage;
  • Tests for the generator itself;
  • Optional Prometheus integration;
  • Optional Sentry integration;
  • Optional Loguru logger;
  • Optional Opentelemetry integration.
  • Optional taskiq integration.

This project can handle arguments passed through command line.

$ python -m fastapi_template --help

Usage: fastapi_template [OPTIONS]

Options:
  -n, --name TEXT                 Name of your awesome project
  -V, --version                   Prints current version
  --force                         Owerrite directory if it exists
  --quiet                         Do not ask for features during generation
  --api-type [rest|graphql]       Select API type for your application
  --db [none|sqlite|mysql|postgresql|mongodb]
                                  Select a database for your app
  --orm [none|ormar|sqlalchemy|tortoise|psycopg|piccolo|beanie]
                                  Choose Object–Relational Mapper lib
  --ci [none|gitlab_ci|github]    Select a CI for your app
  --redis                         Add redis support
  --add_users                     Add fastapi-users support
  --rabbit                        Add RabbitMQ support
  --taskiq                        Add Taskiq support
  --migrations                    Add Migrations
  --dummy                         Add dummy model
  --routers                       Add example routers
  --swagger                       Add self hosted swagger
  --prometheus                    Add prometheus compatible metrics
  --sentry                        Add sentry integration
  --loguru                        Add loguru logger
  --opentelemetry                 Add opentelemetry integration
  --traefik                       Adds traefik labels to docker container
  --kafka                         Add Kafka support
  --gunicorn                      Add gunicorn server
  --cookie-auth                   Add authentication via cookie support
  --jwt-auth                      Add JWT auth support
  --help                          Show this message and exit.
Dépôts similaires
fastapi/fastapi

FastAPI framework, high performance, easy to learn, fast to code, ready for production

PythonPyPIMIT Licensepythonjson
fastapi.tiangolo.com
100.8k9.7k
headroomlabs-ai/headroom

Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.

PythonPyPIApache License 2.0agentai
headroom-docs.vercel.app/docs
61k4.6k
fastapi/full-stack-fastapi-template

Full stack, modern web application template. Using FastAPI, React, SQLModel, PostgreSQL, Docker, GitHub Actions, automatic HTTPS and more.

TypeScriptnpmMIT Licensepythonjson
44.4k8.8k
mouredev/Hello-Python

Curso para aprender el lenguaje de programación Python desde cero y para principiantes. 100 clases, 44 horas en vídeo, código, proyectos y grupo de chat. Fundamentos, frontend, backend, testing, IA...

PythonPyPIApache License 2.0fastapimongodb
mouredev.link/python
36.5k2.3k
jina-ai/serve

☁️ Build multimodal AI applications with cloud-native stack

PythonPyPIApache License 2.0neural-searchcloud-native
jina.ai/serve
21.9k2.2k
Zeyi-Lin/HivisionIDPhotos

⚡️HivisionIDPhotos: a lightweight and efficient AI ID photos tools. 一个轻量级的AI证件照制作算法。

PythonPyPIApache License 2.0demogradio
modelscope.cn/studios/SwanLab/HivisionIDPhotos
21.3k2.4k
Evil0ctal/Douyin_TikTok_Download_API

🚀「Douyin_TikTok_Download_API」是一个开箱即用的高性能异步抖音、快手、TikTok、Bilibili数据爬取工具,支持API调用,在线批量解析及下载。

PythonPyPIApache License 2.0pythonpywebio
douyin.wtf
18.9k2.7k
fastapi/sqlmodel

SQL databases in Python, designed for simplicity, compatibility, and robustness.

PythonPyPIMIT Licensepythonsql
sqlmodel.tiangolo.com
18.2k873
zhanymkanov/fastapi-best-practices

FastAPI Best Practices and Conventions we used at our startup

fastapibest-practices
17.7k1.3k
MODSetter/SurfSense

Open-source NotebookLM alternative. Research the open web with live data, through one platform, API or MCP server. Join our Discord: https://discord.gg/ejRNvftDp9

PythonPyPIOtheraifastapi
surfsense.com
15.3k1.5k
DataTalksClub/machine-learning-zoomcamp

Learn ML engineering for free in 4 months! Register here 👇🏼

Jupyter Notebookcoursedeployment
airtable.com/shryxwLd0COOEaqXo
13.7k3.1k
JoeanAmier/XHS-Downloader

小红书(XiaoHongShu、RedNote)链接提取/作品采集工具:提取账号发布、收藏、点赞、专辑作品链接;提取搜索结果作品、用户链接;采集小红书作品信息;提取小红书作品下载地址;下载小红书作品文件

PythonPyPIGNU General Public License v3.0pythonjson
discord.com/invite/ZYtmgKud9Y
12k1.8k