Nitro
An async-first Python web framework with its server compiled in.
# routes.py
from nitro.routing import HTTPRoute
from nitro.protocols import HttpRequest, HttpResponse, JSONResponse
async def show_user(request: HttpRequest, user_id: int) -> HttpResponse:
return JSONResponse({"id": user_id, "name": "Ada"})
patterns = [
HTTPRoute("/users/<int:user_id>", show_user, name="user"),
]
# app.py
from nitro import Nitro
app = Nitro(routes="routes")
nitro app:app
A project usually points the ROUTES setting at its route module rather than
naming it here. Handlers can also be registered on the application directly with
@app.route(...).
Installation
pip install nitro-framework
Python 3.13 or newer. The distribution is named nitro-framework; the package
it installs is nitro, which is what you import. The wheel carries the compiled
server, so there is nothing to build.
Extras pull in the clients particular backends need:
pip install "nitro-framework[redis]"
aws, azure, email-oauth, memcached, redis, sendgrid, and all.
nitro-intercom is published from this repository too, from the same tag and at
the same version, so either package at a given version was built from the same
source. A Nitro project does not install it — see
docs/intercom.md.
Not an ASGI framework
Nitro does not implement ASGI and does not ship an adapter for it. The server — HTTP/1.1, HTTP/2, HTTP/3, WebSocket and WebTransport — is part of the package and calls your application directly.
That is a design choice rather than an omission. An intermediate protocol limits a server to what the protocol can express and charges every request for a translation into dictionaries and callables. Removing it is what lets routing, header handling, file serving, range requests and streaming backpressure live in compiled code while handlers stay ordinary Python coroutines.
The trade is worth stating plainly: a Nitro application runs on the Nitro server. It cannot be deployed under Uvicorn or Hypercorn, and it cannot mount an ASGI application inside itself.
Documentation
Start with the overview.
| Routing | Paths, converters, mounting, reversing |
| Requests and responses | Reading a request, sending files and streams |
| WebSocket and WebTransport | Real-time connections |
| Intercom | Publish/subscribe between connections |
| Settings | Configuration, including the server's own |
| Dependency injection | Depends, and why its cache is per request |
| Middleware | Wrapping handlers |
| Sessions | Server-side state, and the origin check that guards it |
| Caching · Storage · Templates · Mail | Batteries |
| Logging | The LOGGING setting, and how it differs from the server's log |
| Observability | Prometheus metrics |
| Command line | Serving, check, shell |
| Deployment | Workers, TLS, HTTP/3, draining |
| Testing | Driving an application in-process |
Layout
| Path | Contents |
|---|---|
nitro/ |
The framework |
nitro-intercom/ |
Standalone publish/subscribe client for non-Nitro services |
crates/nitro-core/ |
Transport, lifecycle and routing — pure Rust, no interpreter |
crates/nitro-observability/ |
Prometheus metrics and the exporter — pure Rust, no interpreter |
crates/nitro-py/ |
Python bindings for the server (nitro._nitro) |
crates/intercom-core/ |
Publish/subscribe channels — pure Rust, no interpreter |
crates/intercom-py/ |
Python bindings for Intercom (nitro_intercom._intercom) |
The two core crates know nothing about Python. Everything that needs an interpreter goes through a trait the binding crate implements, which is what keeps the whole request path testable without one.
Development
python -m venv .venv && . .venv/bin/activate
pip install maturin
maturin develop --extras dev # builds the extension into the venv
cargo test --workspace # Rust
pytest # Python
(cd nitro-intercom && pytest) # the standalone package
Tests that need Redis skip when there is not one reachable at
127.0.0.1:6379, so a checkout without it still runs green.
Contributing
See CONTRIBUTING.md for how to get set up and what CI will check. Security issues go to SECURITY.md rather than the issue tracker. Changes worth knowing about are in CHANGELOG.md.
License
Licensed under either of Apache License, Version 2.0 or the MIT license, at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you shall be dual licensed as above, without any additional terms or conditions.
Copyright 2026 Jaldis B.V.
Metadata
Release files for nitro-framework 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nitro_framework-0.3.0.tar.gz | 303.9 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| nitro_framework-0.3.0-cp313-abi3-win_amd64.whl | CPython 3.13 | abi3 | Windows x86-64 | Details |
| nitro_framework-0.3.0-cp313-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.13 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| nitro_framework-0.3.0-cp313-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.13 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| nitro_framework-0.3.0-cp313-abi3-macosx_11_0_arm64.whl | CPython 3.13 | abi3 | macOS 11.0+ ARM64 | Details |
Total release size: 19.4 MB
Release files / nitro_framework-0.3.0.tar.gz
| Download URL | nitro_framework-0.3.0.tar.gz |
|---|---|
| Size | 303.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2d0bda1fb3d60666bb70660d4b8aaea24650a5b510d9b0762a6025cef807a550
|
|
BLAKE2b-256 checksum How to use checksums |
5b7c34b4715e611d7a16a1b2502d9363ce3a642ddb0f331931d96c1ab1f7c987
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / nitro_framework-0.3.0-cp313-abi3-win_amd64.whl
| Download URL | nitro_framework-0.3.0-cp313-abi3-win_amd64.whl |
|---|---|
| Size | 4.7 MB |
| Tags | CPython 3.13 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
dc5bc977489665314b945e6ddc90d24f47290af4f61ab1fd695b9614ae6375f6
|
|
BLAKE2b-256 checksum How to use checksums |
6c349e514cf42014ecc71bb4a61d7d78e2dd4c36cae2447bcd2b6cac3a7510e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / nitro_framework-0.3.0-cp313-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | nitro_framework-0.3.0-cp313-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 4.9 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
b766cca1681a6c7c8715264b68c3b301c6ee39abbab80c706d36bbf35f16a9d8
|
|
BLAKE2b-256 checksum How to use checksums |
441a792dd29f34405957707fa7e6d433706cf573e2094c9928202d6fe828478e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / nitro_framework-0.3.0-cp313-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | nitro_framework-0.3.0-cp313-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 4.9 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
041727d33cd2fb58f421d8b3c39375d757e178758e1c598dcd7fec2cc2d33d76
|
|
BLAKE2b-256 checksum How to use checksums |
a2bf6870bbf8368a2a35a5370e6189cd3954f9cd7a679610e8d5c103dc112401
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / nitro_framework-0.3.0-cp313-abi3-macosx_11_0_arm64.whl
| Download URL | nitro_framework-0.3.0-cp313-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 4.5 MB |
| Tags | CPython 3.13 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
b491b3300d3f213f389ac2f5f4f3d113e0e33990134f1155544464d65d7a8b55
|
|
BLAKE2b-256 checksum How to use checksums |
9e51bb9b62dcacf8cf910b76eebb634fd98c8dd998ae6e6f81a6fe8bfb2f0258
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency log