Skip to main content

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.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nitro-framework 0.2.0
File Size Uploaded
nitro_framework-0.2.0.tar.gz 302.8 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for nitro-framework 0.2.0
File
nitro_framework-0.2.0-cp313-abi3-win_amd64.whl CPython 3.13 abi3 Windows x86-64 Details
nitro_framework-0.2.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.2.0-cp313-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.13 abi3 Linux glibc 2.17+ ARM64 Details
nitro_framework-0.2.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.2.0.tar.gz

Download URL nitro_framework-0.2.0.tar.gz
Size 302.8 kB
Tags Source
SHA-256 checksum
How to use checksums
19c894c4c6bb1cab439133569efec14a992e19c9c7a95fde7f13021c458541df
BLAKE2b-256 checksum
How to use checksums
3708caa7bfb9a22597dc142e4ca43d5e3bd78c813e639c67491f41f0440d17a9
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 18, 2026.

Transparency log

Release files / nitro_framework-0.2.0-cp313-abi3-win_amd64.whl

Download URL nitro_framework-0.2.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
dd077acecfcc995311ec3a8ce342a50548d88daf8fdc8b61b250ab40b17303af
BLAKE2b-256 checksum
How to use checksums
f2cae1f0ce7ea08e648aa5cdb67b602a9147722c8e2095213b935db305f97018
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 18, 2026.

Transparency log

Release files / nitro_framework-0.2.0-cp313-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL nitro_framework-0.2.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
6aeb7905ffd5229fd55c52e30cc36d8f828d4aa11d2634087e1ef34a65987fd2
BLAKE2b-256 checksum
How to use checksums
f9e1724420332ca8ec6dee45fdd7b55b1190c2b4b173a21b839da3806ba44060
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 18, 2026.

Transparency log

Release files / nitro_framework-0.2.0-cp313-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL nitro_framework-0.2.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
815c393da19be840465ff801228e1038bc11bb224b2dbb4558bffab392e5f845
BLAKE2b-256 checksum
How to use checksums
abbecf0a1496bac0f1b02967c1cc3af953db87f502fc4fe6e3a7e421710daaee
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 18, 2026.

Transparency log

Release files / nitro_framework-0.2.0-cp313-abi3-macosx_11_0_arm64.whl

Download URL nitro_framework-0.2.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
9f8b659288e6c2e523077265078b6921cc7366fdf0c3cb631b603a6ce5b11b8b
BLAKE2b-256 checksum
How to use checksums
39d0e109ee780704535966cfbe3e8656e5cfdf0e37fa38a25e637e92db8ce606
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 18, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.1

5 release files

0.3.0

5 release files

This release

0.2.0 This release

5 release files

0.1.0

5 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page