Skip to main content

Ferronit

English · Русский

PyPI Python License GitHub stars

A high-performance Python ASGI framework with a Rust core. Routing, request parsing, JSON, gzip and CORS run in native code; your handlers stay plain Python.

Documentation: docs/ — quick start, routing, requests, dependency injection, the data layer (three options), DDD/DI, the Rust core, benchmarks, ASVS. (Docs are currently written in Russian.)

Installation

pip install ferronit        # installs the Python layer and the native core together (ferronit._core + ferronit.db)

Ferronit is a single package built with maturin as a mixed project. The core (ferronit._core) is compiled with the abi3-py312 feature, so one wheel works on every CPython from 3.12 to 3.14+. It has no runtime dependencies.

# app.py
from ferronit import Ferronit

app = Ferronit()

@app.route("/hello/{name}")
async def hello(name: str):
    return {"hello": name}
ferronit dev                          # dev server (uvicorn, reload)
ferronit dev --server granian         # granian (Rust, ~4× faster)
ferronit run --workers 4              # production: granian, uvicorn fallback

Why it is fast

Routing is Rust matchit, effectively O(1): Ferronit does not degrade as the number of routes grows, while FastAPI loses up to 4× inside a single routing table. Methodology — ab (C client) only; the full analysis is in docs/benchmarks.md.

Scenario Ferronit FastAPI Gap
uvicorn, 1000 routes 20 216 req/s 2 817 req/s ×7.2
granian, 1000 routes 94 873 req/s 3 416 req/s ×27.8

Data layer

Three options for different jobs — from "request → whole JSON response in Rust" to a full ORM. Which one to pick: docs/data/overview.md.

Development

poetry install --all-extras             # environment in .venv + all dependencies
PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 poetry run maturin develop --release   # build the Rust core
./scripts/check.sh                      # lint → types → docstrings → core build → tests
poetry run pytest tests/ -q             # 263 tests

Poetry manages the environment (poetry.toml keeps the venv inside the project), while the wheel carrying the Rust core is built by maturin (see [tool.maturin] in pyproject.toml), so Poetry itself never installs the project.

  • AGENTS.md — guidance for code agents (Claude Code, Codex, Cursor, …).
  • examples/ — minimal, DI, LLM + SSE, RAG, WebSocket; examples/app.py is the DDD example.
  • The package ships py.typed; type stubs for the Rust core live in ferronit/_core.pyi.
  • bench/ — the measurement rig behind every number above; not part of the package.

Release

# the version lives in two files: ferronit/__init__.py and ferronit-rs/Cargo.toml
git tag -a v0.9.1 -m "Ferronit 0.9.1" && git push origin v0.9.1

Pushing a v* tag triggers .github/workflows/release.yml: checks and tests → wheels (Linux glibc/musl, macOS, Windows) and sdist → GitHub Release with the artifacts → publish to PyPI (API token from the PYPI_API_TOKEN repository secret). If the tag version does not match Cargo.toml/__init__.py, the workflow fails before publishing anything.

Docker

docker build -t ferronit:0.9.1 .
docker run --rm -p 8000:8000 ferronit:0.9.1

License

Apache License 2.0 — see LICENSE. Use, modification and distribution are permitted, including commercial use; copyright notices and the patent grant must be preserved.

Metadata

Release files for ferronit 0.9.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 ferronit 0.9.1
File Size Uploaded
ferronit-0.9.1.tar.gz 81.7 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for ferronit 0.9.1
File
ferronit-0.9.1-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details
ferronit-0.9.1-cp312-abi3-musllinux_1_2_x86_64.whl CPython 3.12 abi3 Linux musl 1.2+ x86-64 Details
ferronit-0.9.1-cp312-abi3-manylinux_2_28_x86_64.whl CPython 3.12 abi3 Linux glibc 2.28+ x86-64 Details
ferronit-0.9.1-cp312-abi3-manylinux_2_28_aarch64.whl CPython 3.12 abi3 Linux glibc 2.28+ ARM64 Details
ferronit-0.9.1-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details
ferronit-0.9.1-cp312-abi3-macosx_10_12_x86_64.whl CPython 3.12 abi3 macOS 10.12+ x86-64 Details

Total release size: 11.1 MB

Release files / ferronit-0.9.1.tar.gz

Download URL ferronit-0.9.1.tar.gz
Size 81.7 kB
Tags Source
SHA-256 checksum
How to use checksums
dd04be2369e4c921eaaaba722a177a676ffe71ef860dbd4519a009a4963f5acd
BLAKE2b-256 checksum
How to use checksums
efeab7158d81902edc5465007d268ae9055246788177b39c5bda9adac9db1652
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / ferronit-0.9.1-cp312-abi3-win_amd64.whl

Download URL ferronit-0.9.1-cp312-abi3-win_amd64.whl
Size 1.8 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
9b80fcde08face052d5d89bac6fae8fe959c2d888eb89049b69c0327efe244e1
BLAKE2b-256 checksum
How to use checksums
2c101a4c0841c8b2b503a251a61e49dd86cd08636c64293c0d8279add271da1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / ferronit-0.9.1-cp312-abi3-musllinux_1_2_x86_64.whl

Download URL ferronit-0.9.1-cp312-abi3-musllinux_1_2_x86_64.whl
Size 2.1 MB
Tags CPython 3.12 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
615f0bd0e4e2b2a13fb7bd6de185de46aa5efa147174fc58c150e21709c70471
BLAKE2b-256 checksum
How to use checksums
953ae126dafeb499ec763d0321e829486cb1a0674f54feda393718e539fa005f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / ferronit-0.9.1-cp312-abi3-manylinux_2_28_x86_64.whl

Download URL ferronit-0.9.1-cp312-abi3-manylinux_2_28_x86_64.whl
Size 1.9 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
d6b658accaae817d918a4330e390b92fd108aabaec387026850848a199e73733
BLAKE2b-256 checksum
How to use checksums
3bbbaef894f0a8f74a8d03c71955ccd647e7f3b916dea7e32d3899701478d5b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / ferronit-0.9.1-cp312-abi3-manylinux_2_28_aarch64.whl

Download URL ferronit-0.9.1-cp312-abi3-manylinux_2_28_aarch64.whl
Size 1.8 MB
Tags CPython 3.12 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
2f2d697f45741ca1055994c7811fcbc061d746b033b04216ae1c3c240fa94f26
BLAKE2b-256 checksum
How to use checksums
96a30d1cc4b70ebd0c1eb13615fcdf3e08ef8bf89957d7dac4fb3a891ebf6e2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / ferronit-0.9.1-cp312-abi3-macosx_11_0_arm64.whl

Download URL ferronit-0.9.1-cp312-abi3-macosx_11_0_arm64.whl
Size 1.7 MB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3e12b61ff214c1a723881538769892b33d9dd038fcdd2a0e0ea8ffb5d5bfd27b
BLAKE2b-256 checksum
How to use checksums
7ccb7167021274fe37f09e91dfef0974b8c123ffcb7f0119efc432504aee89b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / ferronit-0.9.1-cp312-abi3-macosx_10_12_x86_64.whl

Download URL ferronit-0.9.1-cp312-abi3-macosx_10_12_x86_64.whl
Size 1.8 MB
Tags CPython 3.12 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
6909ff8979af29094d8dcd29f56d92f23d82200818eb30ccb0a76271fbb3bfb3
BLAKE2b-256 checksum
How to use checksums
ab4856e1b1fa7ed25f2bd92239d247a4bf1d5d45c344ea6845cfa99988134513
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

0.14.0

7 release files

0.13.0

7 release files

0.12.2

7 release files

0.12.1

7 release files

0.12.0

7 release files

0.11.0

7 release files

0.10.0

7 release files

This release

0.9.1 This release

7 release files

0.9.0

7 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