modern-python/fastapi-sqlalchemy-template
Sobre
Dockerized FastAPI + SQLAlchemy 2 + PostgreSQL app template with DI
Dados e análiseO que você pode fazer
- tests on pytest with automatic rollback after each test case
- IOC (Inversion of Control) container built on modern-di
- Observability tools integration built on lite-bootstrap
- Linting and formatting with ruff, type checking with ty
Crescimento medido de estrelas
- em 24 h
- +1
- em 7 dias
- +1
- em 15 dias
- 0
- em 1 mês
- Coletando histórico
Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.
README.md
Original
Description
Dockerized FastAPI, SQLAlchemy 2 and PostgreSQL app template with DI.
Key features
- tests on
pytestwith automatic rollback after each test case - IOC (Inversion of Control) container built on modern-di
- Observability tools integration built on lite-bootstrap
- Linting and formatting with
ruff, type checking withty Alembicfor DB migrations
Authentication is intentionally omitted: pick the scheme that fits your project and add it as a FastAPI dependency.
After git clone run
just --list
Tracing in production
Setting OPENTELEMETRY_ENDPOINT turns tracing on, and by default every request is traced. In a benchmark of GET /api/decks/{id}/, that cut throughput by about 40%. Sampling with the standard OpenTelemetry variables brings that down to about 20%:
OTEL_TRACES_SAMPLER=parentbased_traceidratio
OTEL_TRACES_SAMPLER_ARG=0.1
This keeps one trace in ten, and follows the caller's decision when a request arrives with a trace context. Errors still reach Sentry when SENTRY_DSN is set.
The template also turns off the ASGI send and receive spans (opentelemetry_exclude_spans in app/settings.py), so each request records its server span and database spans only. With every request traced, that raised throughput by 5 to 8% in the same benchmark. Remove the setting if you need those spans.
Links
If this project saves you time, consider giving it a star on GitHub.
Part of modern-python
Browse the full list of templates and libraries in
modern-python; the org profile has the categorized index.
Explore projetos relacionados
Carregando…