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

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.2
File Size Uploaded Provenance Actions
nitro_framework-0.3.2.tar.gz 304.8 kB With provenance Details for nitro_framework-0.3.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for nitro-framework 0.3.2
File Actions
nitro_framework-0.3.2-cp313-abi3-win_amd64.whl CPython 3.13 abi3 Windows x86-64 Details for nitro_framework-0.3.2-cp313-abi3-win_amd64.whl
nitro_framework-0.3.2-cp313-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.13 abi3 Linux glibc 2.17+ x86-64 Details for nitro_framework-0.3.2-cp313-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
nitro_framework-0.3.2-cp313-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.13 abi3 Linux glibc 2.17+ ARM64 Details for nitro_framework-0.3.2-cp313-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
nitro_framework-0.3.2-cp313-abi3-macosx_11_0_arm64.whl CPython 3.13 abi3 macOS 11.0+ ARM64 Details for nitro_framework-0.3.2-cp313-abi3-macosx_11_0_arm64.whl

Total release size: 19.5 MB

Release files / nitro_framework-0.3.2.tar.gz

Download URL nitro_framework-0.3.2.tar.gz
Size 304.8 kB
Tags Source
SHA-256 checksum
How to use checksums
67329d3418de006eb86cafb2746fa2a235d62e889dec0393438da9f1a6f59654
BLAKE2b-256 checksum
How to use checksums
81816862b971296ee9a05cf7d087b669945cafedaa85c70365891c8973fba56d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 4, 2026.

Transparency log

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

Download URL nitro_framework-0.3.2-cp313-abi3-win_amd64.whl
Size 4.8 MB
Tags CPython 3.13 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
c3409e6297d7bb77cbd12f0446618487d80e628829bbebddc433e3ed1d530a23
BLAKE2b-256 checksum
How to use checksums
10d816bd349074372b7404bc7d31fda4dbc230e996c7318b15660aa6351f4a20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 4, 2026.

Transparency log

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

Download URL nitro_framework-0.3.2-cp313-abi3-manylinux2014_x86_64.manylinux_2_17_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
5f0967107bdb9ce29a39150247b900c7755235b295c0656f5d68655f49e232bb
BLAKE2b-256 checksum
How to use checksums
cdd6f9fb64a54297fac51f2a1b425e7e2a39f615f1aaa5c7707fd5965afc51d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 4, 2026.

Transparency log

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

Download URL nitro_framework-0.3.2-cp313-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 4.9 MB
Tags CPython 3.13 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
a801e34db028ae30ad78610cfda41e0405720c411e586f59538fa37758f720a8
BLAKE2b-256 checksum
How to use checksums
fb294ab2886b872c19b65d55f99518898c63feebcfca1fce05f7222b43267f70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 4, 2026.

Transparency log

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

Download URL nitro_framework-0.3.2-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
d2a4255138dca5e0b6ce75ebe18f585fc174887812051ac3096fbf1c76fd01e3
BLAKE2b-256 checksum
How to use checksums
0c69ca9860582fee704c0b3782efd865bdecdf0777aa258ce0f1877bac1a2a5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 4, 2026.

Transparency log

Security for nitro-framework 0.3.2

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.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for nitro_framework-0.3.2.tar.gz

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 Nov 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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