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.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 ferro-orm 0.26.1
File Size Uploaded Provenance Actions
ferro_orm-0.26.1.tar.gz 2.7 MB With provenance Details for ferro_orm-0.26.1.tar.gz

Built distributions (wheels)

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

Total release size: 36.1 MB

Release files / ferro_orm-0.26.1.tar.gz

Download URL ferro_orm-0.26.1.tar.gz
Size 2.7 MB
Tags Source
SHA-256 checksum
How to use checksums
9f7729dd521c3add2ad555dc168be259f440961a1ebcc911ec7850c791914480
BLAKE2b-256 checksum
How to use checksums
ac0d0ea997e4bdb10db00955737253dfd8223569567662a93b844af3a78e78d9
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 26, 2026.

Transparency log

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

Download URL ferro_orm-0.26.1-cp39-abi3-win_amd64.whl
Size 8.2 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
bbc1ad31e9c3a3dc53eaf1f084370c8e536a3ffb24198f830597ba41fded49f5
BLAKE2b-256 checksum
How to use checksums
320779f6562c91c0debb8fc89a1321499825393aea879de19177789fab33e1cf
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 26, 2026.

Transparency log

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

Download URL ferro_orm-0.26.1-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
5350ad350736b246ab343db5f86d6c541e4a5afce1e7ba6d144f0bbfa5b5e822
BLAKE2b-256 checksum
How to use checksums
caec66d347a7c29e9f3d11e7f4c105c55a2d9af6a4b6a9b59f182aba7913558f
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 26, 2026.

Transparency log

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

Download URL ferro_orm-0.26.1-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
9d29e150b8dbf406541dbbdca2340a77a981dbda980bf921e354f67ad52fee46
BLAKE2b-256 checksum
How to use checksums
682cefecf49dc156b970d94fe4e783202877c7f49698275eac582e601552bc0d
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 26, 2026.

Transparency log

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

Download URL ferro_orm-0.26.1-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
474c3dd56f65825ed27f0a9bf456a85e98ca804460c90fb53ac6bed641541014
BLAKE2b-256 checksum
How to use checksums
6fb9955901548ad9fed058a6d2059fb676213ce097587dc7d248844082284174
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 26, 2026.

Transparency log

Security for ferro-orm 0.26.1

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.1.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 26, 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.1 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