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

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.3.1
File Size Uploaded
nitro_framework-0.3.1.tar.gz 303.9 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for nitro-framework 0.3.1
File
nitro_framework-0.3.1-cp313-abi3-win_amd64.whl CPython 3.13 abi3 Windows x86-64 Details
nitro_framework-0.3.1-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.1-cp313-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.13 abi3 Linux glibc 2.17+ ARM64 Details
nitro_framework-0.3.1-cp313-abi3-macosx_11_0_arm64.whl CPython 3.13 abi3 macOS 11.0+ ARM64 Details

Total release size: 19.5 MB

Release files / nitro_framework-0.3.1.tar.gz

Download URL nitro_framework-0.3.1.tar.gz
Size 303.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4ba133c9e3ff6bc7289808f7aa6e2d5e57731b96854eb7ae1f15e52d91591527
BLAKE2b-256 checksum
How to use checksums
2f948222cb36b2b45cad537d452b2e62952f59eb8ba732985a270ab977127ded
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 Oct 14, 2026.

Transparency log

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

Download URL nitro_framework-0.3.1-cp313-abi3-win_amd64.whl
Size 4.7 MB
Tags CPython 3.13 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
4f16be0c6f2fa36e23cf702fa3b4f896d3b3dc17b42ad2fab9894518a42a3a9e
BLAKE2b-256 checksum
How to use checksums
a26d023663889a1484ad856c8442fea9449dfcf728d38abe36b50fd85b27c02e
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 Oct 14, 2026.

Transparency log

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

Download URL nitro_framework-0.3.1-cp313-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 5.0 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
774bf4e3f18ab92e3d322c3c630f2a677d4277b3e26d93da74e5096aff029a2b
BLAKE2b-256 checksum
How to use checksums
13e3e50399d6c10b3178542906e0f85b04545889d19e1b20f88d7ccd82401f80
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 Oct 14, 2026.

Transparency log

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

Download URL nitro_framework-0.3.1-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
284d32eeb00eb78f24b619968061c868c3ab385364292809f3da6ad17a7f46a5
BLAKE2b-256 checksum
How to use checksums
890d73469c183bb6c9f3b0a34e118efc63af2b640751313586ae4c3bafeb2a63
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 Oct 14, 2026.

Transparency log

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

Download URL nitro_framework-0.3.1-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
7c9db192fa345258e1893aff135f322b18e7f1e59e23302911e55ab9807c877c
BLAKE2b-256 checksum
How to use checksums
520df7b0559b6d3e308f93242f755cbb555b0ab5a88fb23d2e6d5e11bf1e7fb5
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 Oct 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.1 This release

5 release files

0.3.0

5 release files

0.2.0

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