TurboAPI - a high-performance ASGI framework with compiled routing, DI, validation, and OpenAPI.
Project description
py-turbo-api
TurboAPI is a small, fast ASGI web framework built from scratch (stdlib-only) with a focus on predictable performance.
Features
- Trie router with
{param}path params APIRoutercomposition with prefixes/tags viainclude_router()- Compiled route plans (signature inspection happens at route registration, not per request)
- Dependency injection with
Depends()including nested and yield-based dependencies - Parameter source markers:
Query,Header,Cookie,Form,File - Built-in validation with
Model+field()(supportsAnnotated,Literal,Enum,datetime,UUID,Decimal) - Multipart/form-data parsing with
UploadFile - Multipart hardening: per-file/part/field limits + upload spooling to disk
StreamingResponse,FileResponse,BackgroundTask, and static file mounting- Response primitives:
RedirectResponse,NegotiatedResponse, cache header helpers, andEventSourceResponsefor SSE - File hardening:
ETag/If-None-Match+ byte range (206/416) support - WebSocket route support via
@app.websocket(...) - Sub-app mounting via
app.mount("/prefix", sub_app)and host routing viaapp.mount_host("*.example.com", app) - WebSocket auth helpers (
websocket_token_auth,websocket_jwt_auth) and OpenAPI WS extension docs (x-turbo-websockets) - Security primitives:
api_key_auth(),bearer_auth(),jwt_auth(), OAuth2 password/auth-code/client-credentials helpers with OpenAPI security schemas - Session + CSRF protection primitives (
SessionMiddleware,CSRFMiddleware, CSRF helpers) - OpenAPI at
/openapi.json - Swagger UI at
/docsand ReDoc at/redoc - Lifespan startup/shutdown handlers
- Custom exception handlers with
@app.exception_handler(...) - Reliability defaults: request timeout, max body size, max concurrency
- Runtime settings model (
TurboSettings) +Turbo.from_env()for env-driven deploy config - Graceful shutdown request draining (
shutdown_drain_timeout) - CI release gates: Python matrix tests/lint + package build and
twine check, with trusted publishing workflow - Benchmark suite + perf regression gates in CI (
benchmarks/bench_runtime.py)
Stability
- Compatibility policy:
API_COMPATIBILITY.md - Current status: pre-1.0 (public API is stabilizing toward
v1.1.0)
Install
From PyPI
pip install py-turbo-api
PyPI: https://pypi.org/project/py-turbo-api/
Run example
uvicorn app:app --reload
Open:
Documentation Tracks
- Docs home (GitHub Pages entry):
docs/index.md - Complete API reference:
docs/api-reference.md - Tutorial:
docs/tutorial.md - Advanced:
docs/advanced.md - Deployment:
docs/deployment.md - Security recipes:
docs/security-recipes.md - Why TurboAPI + benchmark method:
docs/why-turboapi.md
Benchmarks
python benchmarks/bench_runtime.py --baseline benchmarks/baseline.json --tolerance 1.20 --gate
License
Apache-2.0 (see LICENSE).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file py_turbo_api-1.0.2.tar.gz.
File metadata
- Download URL: py_turbo_api-1.0.2.tar.gz
- Upload date:
- Size: 67.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b119cd0f1d49f7ddf9d8a39ed15df2419f3358e8a9306a579222d5b20c6956df
|
|
| MD5 |
ac8da3d6afe75218e3c04f10552afe1a
|
|
| BLAKE2b-256 |
537386e7fefb139e30e3643171864d24c60db2cbc17d97dbb24994abf6cad7ca
|
Provenance
The following attestation bundles were made for py_turbo_api-1.0.2.tar.gz:
Publisher:
publish.yml on pareshpanat/turboapi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
py_turbo_api-1.0.2.tar.gz -
Subject digest:
b119cd0f1d49f7ddf9d8a39ed15df2419f3358e8a9306a579222d5b20c6956df - Sigstore transparency entry: 953420605
- Sigstore integration time:
-
Permalink:
pareshpanat/turboapi@c78ae6c0eb25f2b81e0526baf0e735771db04fda -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/pareshpanat
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c78ae6c0eb25f2b81e0526baf0e735771db04fda -
Trigger Event:
push
-
Statement type:
File details
Details for the file py_turbo_api-1.0.2-py3-none-any.whl.
File metadata
- Download URL: py_turbo_api-1.0.2-py3-none-any.whl
- Upload date:
- Size: 56.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4b8351e5b676dfd9d27da34cc3c4c7574915621b51786c99179494a4fc32d74
|
|
| MD5 |
c939af7d220fbef545cc133bd020670b
|
|
| BLAKE2b-256 |
387e2f4d679c475c4e8670382a5664b788c8ecd823e09396629aa82e6edb4080
|
Provenance
The following attestation bundles were made for py_turbo_api-1.0.2-py3-none-any.whl:
Publisher:
publish.yml on pareshpanat/turboapi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
py_turbo_api-1.0.2-py3-none-any.whl -
Subject digest:
b4b8351e5b676dfd9d27da34cc3c4c7574915621b51786c99179494a4fc32d74 - Sigstore transparency entry: 953420606
- Sigstore integration time:
-
Permalink:
pareshpanat/turboapi@c78ae6c0eb25f2b81e0526baf0e735771db04fda -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/pareshpanat
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c78ae6c0eb25f2b81e0526baf0e735771db04fda -
Trigger Event:
push
-
Statement type: