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.26.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.26.0
File Size Uploaded Provenance Actions
ferro_orm-0.26.0.tar.gz 2.7 MB With provenance Details for ferro_orm-0.26.0.tar.gz

Built distributions (wheels)

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

Total release size: 36.1 MB

Release files / ferro_orm-0.26.0.tar.gz

Download URL ferro_orm-0.26.0.tar.gz
Size 2.7 MB
Tags Source
SHA-256 checksum
How to use checksums
0ff3920f9b0fb534dfc2014694663e412e35d75a85119c549c4bc1dc240510b4
BLAKE2b-256 checksum
How to use checksums
33b047a9ddb3fdc0ab8abda00561fcea10cf1878e6af4434849488e9a91e9b65
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 22, 2026.

Transparency log

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

Download URL ferro_orm-0.26.0-cp39-abi3-win_amd64.whl
Size 8.2 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
002023d304f9d3afc702275df2e9f01590bdd42b9a26dcb45e1fc4b263d2bcdd
BLAKE2b-256 checksum
How to use checksums
ce487bd967d805813179da4bc4f2eb00e8744531fb870dff026d08b4be6fe191
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 22, 2026.

Transparency log

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

Download URL ferro_orm-0.26.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 8.6 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
ca912287efb48b91d5e4057cf2c10257827b3c85cd1fb68a17b166aaf30b7598
BLAKE2b-256 checksum
How to use checksums
ae5545b533f8fcbd8fd58e8f8b8c219bd467286f9de68d27b01ce81aa676b766
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 22, 2026.

Transparency log

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

Download URL ferro_orm-0.26.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 8.6 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
1b90ecb36af53824ddf5b8d589dfa40c79bf70a7f322be0b54d337eb4ef4b625
BLAKE2b-256 checksum
How to use checksums
10a67333cfd994234831fb1d7cefb3c2519675583b8df40fb0c0304e28c5a782
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 22, 2026.

Transparency log

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

Download URL ferro_orm-0.26.0-cp39-abi3-macosx_11_0_arm64.whl
Size 7.9 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
8dcc07213dc0b43d4d70dcf7c086f7b72bd926b1be232a37a0f01ea72a9614a2
BLAKE2b-256 checksum
How to use checksums
b2273e05ade34a1a8387120091049428f46add3bd6f2abdf9bee612dc83686c2
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 22, 2026.

Transparency log

Security for ferro-orm 0.26.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.26.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 22, 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.26.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