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.28.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.28.0
File Size Uploaded Provenance Actions
ferro_orm-0.28.0.tar.gz 3.0 MB With provenance Details for ferro_orm-0.28.0.tar.gz

Built distributions (wheels)

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

Total release size: 37.2 MB

Release files / ferro_orm-0.28.0.tar.gz

Download URL ferro_orm-0.28.0.tar.gz
Size 3.0 MB
Tags Source
SHA-256 checksum
How to use checksums
7894187c3533d857ea2025b5af197a9fd566c9ef145f650cbeb62842587441d1
BLAKE2b-256 checksum
How to use checksums
b86c1a8032cbfc0f957fc800047e1e05ff711e2acadb1dc484caa81566c5fa2d
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 17, 2026.

Transparency log

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

Download URL ferro_orm-0.28.0-cp39-abi3-win_amd64.whl
Size 8.4 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
a8251fc4b7647860595962f2b08d8a92daddaf91c545a6dd31bf6d2e24e0004f
BLAKE2b-256 checksum
How to use checksums
df64d8ffbd14fac7a49014fab290b6144e7ef847f54177b9274d1840f7c56213
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 17, 2026.

Transparency log

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

Download URL ferro_orm-0.28.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 8.8 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
07d4fa7d26068250bc71d61c0643d6faffa223e6cb5f3a37fb63be0f04fc8067
BLAKE2b-256 checksum
How to use checksums
5bab3b6a974a07c499829e2503a8c7b438e611bada06153ba2f10f07511876e7
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 17, 2026.

Transparency log

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

Download URL ferro_orm-0.28.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 8.8 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
3e82adbec964293447e531b62c45f3bb506091b39e73215ff5a1b01dcae4f2a2
BLAKE2b-256 checksum
How to use checksums
56b007cb15c7844b044d6585e4e963be74a1bad37ce4bd00e9cdc0a4a26fa1d3
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 17, 2026.

Transparency log

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

Download URL ferro_orm-0.28.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
275795eeb282151198d40cc09bad65b62b05281dc0d1537d5b1e5574871f3c8f
BLAKE2b-256 checksum
How to use checksums
bf74a0a0a34372db0704400587fdb2aeb0b3e78cc0d0621f823dc3c8a8b92dcd
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 17, 2026.

Transparency log

Security for ferro-orm 0.28.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.28.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 17, 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.28.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