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
Observability Prometheus metrics
Command line Serving, check, shell
Deployment Workers, TLS, HTTP/3, draining

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.1.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.1.0
File Size Uploaded
nitro_framework-0.1.0.tar.gz 285.6 kB Details

Built distributions (wheels)

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

Total release size: 19.3 MB

Release files / nitro_framework-0.1.0.tar.gz

Download URL nitro_framework-0.1.0.tar.gz
Size 285.6 kB
Tags Source
SHA-256 checksum
How to use checksums
96337bbbcc9bd892916c81864988844033bae30b32ecdea19ae503d004503f0a
BLAKE2b-256 checksum
How to use checksums
edf1d7682233f2295e0c6b1a42e6111074ba43061d238dd4abe605432c8cc9b5
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 Aug 20, 2026.

Transparency log

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

Download URL nitro_framework-0.1.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
2ecaf6eb0b783f6d2d8335b15b08bc2d5cccb41332759e1a8f63479c1d7de3ff
BLAKE2b-256 checksum
How to use checksums
a73eb7beba54d84ab4198f0e479f1031fc82f4cc0c6c9f3532ef466ef98bdf27
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 Aug 20, 2026.

Transparency log

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

Download URL nitro_framework-0.1.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
4bad256823eb85ffb710d973ebae148c08834dd805691eaec06aa55c54e2f486
BLAKE2b-256 checksum
How to use checksums
1d9b65886dabe6b8cfd25e766df35c30b7aacb6d379a69cf1b4f1743ed6698c2
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 Aug 20, 2026.

Transparency log

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

Download URL nitro_framework-0.1.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
8c12c067e3ba58650a916202c829b0dfca0a4ec3582f3f9511eed906be6ba042
BLAKE2b-256 checksum
How to use checksums
2f071ed71af0da67c976eec320c9c3517cfee3d5a62497651b4bf9e52b62954a
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 Aug 20, 2026.

Transparency log

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

Download URL nitro_framework-0.1.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
ebb96f48b6386242c431bed0d558698f8a48549927eb6209e3a05714b941e313
BLAKE2b-256 checksum
How to use checksums
55a9b5cef15e0aa7dfcccb52e7be70a72d09d24e1d5e45fc9d7a77d81a920bb0
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 Aug 20, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.1

5 release files

0.3.0

5 release files

0.2.0

5 release files

This release

0.1.0 This release

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