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.29.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.29.0
File Size Uploaded Provenance Actions
ferro_orm-0.29.0.tar.gz 3.1 MB With provenance Details for ferro_orm-0.29.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for ferro-orm 0.29.0
File Actions
ferro_orm-0.29.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for ferro_orm-0.29.0-cp39-abi3-win_amd64.whl
ferro_orm-0.29.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.29.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
ferro_orm-0.29.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for ferro_orm-0.29.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
ferro_orm-0.29.0-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for ferro_orm-0.29.0-cp39-abi3-macosx_11_0_arm64.whl

Total release size: 37.7 MB

Release files / ferro_orm-0.29.0.tar.gz

Download URL ferro_orm-0.29.0.tar.gz
Size 3.1 MB
Tags Source
SHA-256 checksum
How to use checksums
a3be100a9b9405bd367ccb196003b530a6ec26299d60a048713f1c3bec0adf66
BLAKE2b-256 checksum
How to use checksums
9c9030fa145c46eb68b8e8d1b8cf1df74e952fbbae6e493f708047b80ea9dfb4
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 20, 2026.

Transparency log

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

Download URL ferro_orm-0.29.0-cp39-abi3-win_amd64.whl
Size 8.6 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
066b6f40a9afbdd735d958ba5e3c39a779ff55f5eff1a792976c41f2b238456d
BLAKE2b-256 checksum
How to use checksums
989a5d0036f5bd00e5325598f90559257806d4a897fa14325b8678869297b91a
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 20, 2026.

Transparency log

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

Download URL ferro_orm-0.29.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
c12c633e610c92060feab17b645dec0a27d0cfb265d925a6b90b19e334fc50df
BLAKE2b-256 checksum
How to use checksums
5aa7d9a9c883c6593d8da734b6f362167ecb6fc84dfb7c889e597ff1735778b1
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 20, 2026.

Transparency log

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

Download URL ferro_orm-0.29.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 9.0 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
81673fce0ac60aa2b4d5a92c5536cbffe6630c040a053eec8c716fc1df5d5f48
BLAKE2b-256 checksum
How to use checksums
007d5857b11e4fc5ee39833113c06ed7a1ec7ef893afa9d8335399cc706ede37
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 20, 2026.

Transparency log

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

Download URL ferro_orm-0.29.0-cp39-abi3-macosx_11_0_arm64.whl
Size 8.2 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a91b4c29565ca78b792db3593984e9b3e4af2802ae2804fad88b97eccf52fe2b
BLAKE2b-256 checksum
How to use checksums
a1c2b78e51784b15f5fbcc618007442767496f7ca8fbcee325c97c0625521cde
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 20, 2026.

Transparency log

Security for ferro-orm 0.29.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.29.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 Nov 20, 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.29.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