Skip to main content

Ferro: The Pydantic x Rust ORM

PyTest Ruff Zensical UV Rust Python PyPI License Downloads Codecov Issues

Ferro is an async ORM for Python: you declare Pydantic models, and a Rust engine builds the SQL, runs it and turns rows into model instances. Its runtime dependencies are Pydantic and pydantic-settings.

Here is a model, a query and the result:

import asyncio

from ferro import Field, Model, connect, engines


class User(Model):
    id: int | None = Field(default=None, primary_key=True)
    username: str
    is_active: bool = True


async def main():
    await connect("sqlite::memory:", auto_migrate=True)

    async with engines.session():
        await User.create(username="alice")
        await User.create(username="bob", is_active=False)

        active_users = await User.where(lambda user: user.is_active == True).all()
        print(f"Found {len(active_users)} active users.")


asyncio.run(main())

Running it prints:

Found 1 active users.

Every ORM call runs inside async with engines.session():, which routes it to the connection you opened. auto_migrate=True creates the table on connect; it suits development and tests.

What Ferro does

  • The Rust engine generates the SQL and parses rows outside the GIL, then fills each model's fields directly, without calling __init__.
  • Everything is async, on pyo3-async-runtimes and SQLx.
  • Models are Pydantic v2 models, so validation and IDE support work as they do for any Pydantic class.
  • Within a session, one database row is one Python object (the identity map).
  • It supports SQLite and PostgreSQL. Both are compiled into the engine, so no driver packages are needed.

Installation

Ferro ships pre-compiled wheels for macOS, Linux and Windows:

pip install ferro-orm
# With the migrations CLI (ferro migrate)
pip install "ferro-orm[cli]"
# With the Alembic bridge
pip install "ferro-orm[alembic]"

Schema changes

Auto-migrate keeps a development database current. For production, ferro migrate new writes reviewed migration files and ferro migrate up applies them; see Schema management. To use more than one database, register named connections with connect(..., name="..."); see Connections.

Metadata

Release files for ferro-orm 0.27.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 ferro-orm 0.27.0
File Size Uploaded Provenance Actions
ferro_orm-0.27.0.tar.gz 2.9 MB With provenance Details for ferro_orm-0.27.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for ferro-orm 0.27.0
File Actions
ferro_orm-0.27.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for ferro_orm-0.27.0-cp39-abi3-win_amd64.whl
ferro_orm-0.27.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for ferro_orm-0.27.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
ferro_orm-0.27.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for ferro_orm-0.27.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
ferro_orm-0.27.0-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for ferro_orm-0.27.0-cp39-abi3-macosx_11_0_arm64.whl

Total release size: 37.3 MB

Release files / ferro_orm-0.27.0.tar.gz

Download URL ferro_orm-0.27.0.tar.gz
Size 2.9 MB
Tags Source
SHA-256 checksum
How to use checksums
de2e0ecb09ff392b8476878d4f96e3a0347bbe7555aa20fc982a47db380cdc2c
BLAKE2b-256 checksum
How to use checksums
d6ecb42191f6b0ac0001e3763c90bdc3cdc12654e94206b24af267fe9d50df3a
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 Oct 30, 2026.

Transparency log

Release files / ferro_orm-0.27.0-cp39-abi3-win_amd64.whl

Download URL ferro_orm-0.27.0-cp39-abi3-win_amd64.whl
Size 8.5 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
be2b69242bea7480a7e9c409236a8ba8274516b017eb63afefb16bded171ebe2
BLAKE2b-256 checksum
How to use checksums
94a28a4f043ce8b6572f0d05a406ca92f7e4e0129459a68c02de9933d60bc79d
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 Oct 30, 2026.

Transparency log

Release files / ferro_orm-0.27.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL ferro_orm-0.27.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 8.9 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
d86acc8c524da6732a8cc9a416c65ba3ccfd7d96b916a15b8c541c3a132f1a20
BLAKE2b-256 checksum
How to use checksums
49edf57d7a5333a4456413ef63eeb3ffa0f377e0a8b16759b81f04b3242ee5cd
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 Oct 30, 2026.

Transparency log

Release files / ferro_orm-0.27.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL ferro_orm-0.27.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 8.9 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
2dc984b940df7cd5839f9894b76ce78d07d56e2ecbdfa41ba32653f8860cb7fb
BLAKE2b-256 checksum
How to use checksums
5101d065a199a4d5321276c874be233237d32e773421a9f3731b36dc137a2541
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 Oct 30, 2026.

Transparency log

Release files / ferro_orm-0.27.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL ferro_orm-0.27.0-cp39-abi3-macosx_11_0_arm64.whl
Size 8.1 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
67e4f676992c37440bd340c2eef644339a9df28f9c93ff7535151f8ccc5cc86f
BLAKE2b-256 checksum
How to use checksums
f1e506424d52bbba8d6d4b3f1bdb602b0ea40784550e40ff732a9f52257da8aa
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 Oct 30, 2026.

Transparency log

Security for ferro-orm 0.27.0

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 ferro_orm-0.27.0.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 Oct 30, 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.

Release history Release notifications | RSS feed

This release

0.27.0 This release

5 release files Full provenance

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