Skip to main content

Ferro: The Pydantic x Rust ORM

PyTest Ruff Zensical UV Rust Python PyPI License Downloads Codecov Issues

Ferro is a high-performance, asynchronous ORM for Python, powered by a core engine written in Rust. Designed for simplicity and it only has one dependency: Pydantic. Delivering ergonomics familiar to the modern Pythonista and the speed and safety of Rust's SQLx and Sea-Query.

Key Features

  • High-Performance Core: All SQL generation and row hydration are handled by a dedicated Rust engine, minimizing "Python Tax" on data-heavy operations.
  • Async First: Built from the ground up for asynchronous applications, utilizing pyo3-async-runtimes for non-blocking I/O.
  • Pydantic Integration: Leverages Pydantic V2 for schema definition and data validation, providing full IDE support and type safety.
  • Zero-Copy Intent: Designed with zero-copy principles to maximize throughput during large-scale data retrieval.
  • Identity Map: Ensures object consistency across your application by tracking active model instances in a thread-safe registry.

Architecture

Ferro operates through a dual-layer architecture connected via a high-performance FFI (Foreign Function Interface) bridge:

  1. Python Layer: Developers define models using standard Python classes; a metaclass registers them with the backend.
  2. Rust Engine: Built on SQLx and Sea-Query for GIL-free row parsing and object instantiation.

Installation

Ferro is distributed as pre-compiled wheels for macOS, Linux, and Windows.

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

Schema changes go through auto-migrate while you develop and reviewed migrations (ferro migrate new, ferro migrate up) in production — see Schema Management. Ferro currently supports SQLite and PostgreSQL. Register multiple named connections with connect(..., name="...") when a process needs more than one database — see the connections guide.

Quick Start

import asyncio
from ferro import Field, Model, connect

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

async def main():
    await connect("sqlite:example.db?mode=rwc", auto_migrate=True)

    # Create
    alice = await User.create(username="alice")

    # Query (lambda predicates — name the parameter after the model, e.g. user for User)
    active_users = await User.where(lambda user: user.is_active == True).all()
    print(f"Found {len(active_users)} active users.")

if __name__ == "__main__":
    asyncio.run(main())

Metadata

Release files for ferro-orm 0.22.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.22.0
File Size Uploaded
ferro_orm-0.22.0.tar.gz 2.3 MB Details

Built distributions (wheels)

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

Total release size: 31.4 MB

Release files / ferro_orm-0.22.0.tar.gz

Download URL ferro_orm-0.22.0.tar.gz
Size 2.3 MB
Tags Source
SHA-256 checksum
How to use checksums
c0ab15e2b158a1d88a0ce84b77b947f6a2711509e6878f3b29807ad5bb889cdf
BLAKE2b-256 checksum
How to use checksums
bf15b2b5256aa4b634ab23990d31eb39ce7d9c79f2ac0d2b25166201bac4edb8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 9, 2026.

Transparency log

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

Download URL ferro_orm-0.22.0-cp39-abi3-win_amd64.whl
Size 7.1 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
d49516bd769379a0ec70ffc7f31a43dd4c7eee3018e7b1b1ca54a22d3d5f0b35
BLAKE2b-256 checksum
How to use checksums
a340a28b088682c2eaecadc87f066ac49433cf1707b490b99dfad3a760cad4f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 9, 2026.

Transparency log

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

Download URL ferro_orm-0.22.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 7.5 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
33105baad2d3062b7c0660db30d22a8d51c46cb2b7237198c327bcecc7ebe4da
BLAKE2b-256 checksum
How to use checksums
876d61a966398fc9ed92c94fbf78c693afd939ae82d4e002a47ee73fefe36b45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 9, 2026.

Transparency log

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

Download URL ferro_orm-0.22.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 7.6 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
6e21e7c5baeb2b1dd39afc779a32f7a8b9e71acf6bcfbd4ea362fe760bb2e7eb
BLAKE2b-256 checksum
How to use checksums
662468fdb6f1fd4ff434b70e3a0ef94e8355d407a43239f455aadcb493c412a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 9, 2026.

Transparency log

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

Download URL ferro_orm-0.22.0-cp39-abi3-macosx_11_0_arm64.whl
Size 6.9 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
82e5959e0450b401b05298cc3235a27afe899cdeaefe8b3e3fd8e747b909ca4d
BLAKE2b-256 checksum
How to use checksums
69ec2d925cc204aadf0cf16c1c3d29ae39851ba3dc549ef977059ab9e941fb95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 9, 2026.

Transparency log

Release history Release notifications | RSS feed

0.24.0

5 release files

0.23.0

5 release files

This release

0.22.0 This release

5 release files

0.21.2

5 release files

0.21.1

5 release files

0.21.0

5 release files

0.20.0

5 release files

0.19.0

5 release files

0.17.1

5 release files

0.17.0

5 release files

0.16.3

5 release files

0.16.2

5 release files

0.16.1

5 release files

0.16.0

5 release files

0.15.0

5 release files

0.12.3

5 release files

0.12.2

5 release files

0.12.1

5 release files

0.12.0

5 release files

0.11.0

5 release files

0.10.5

5 release files

0.10.4

5 release files

0.10.3

5 release files

0.10.2

5 release files

0.10.1

5 release files

0.10.0

5 release files

0.9.2

5 release files

0.9.1

5 release files

0.9.0

5 release files

0.8.0

5 release files

0.7.0

5 release files

0.6.1

5 release files

0.6.0

5 release files

0.5.0

5 release files

0.4.0

5 release files

0.3.4

5 release files

0.3.3

5 release files

0.3.2

5 release files

0.3.1

5 release files

0.3.0

5 release files

0.2.1

5 release files

0.2.0

5 release files

0.1.1

5 release files

0.1.0

5 release files

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