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 migration support
pip install "ferro-orm[alembic]"

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())

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ferro_orm-0.16.0.tar.gz (1.1 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ferro_orm-0.16.0-cp39-abi3-win_amd64.whl (5.0 MB view details)

Uploaded CPython 3.9+Windows x86-64

ferro_orm-0.16.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.5 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

ferro_orm-0.16.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.5 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

ferro_orm-0.16.0-cp39-abi3-macosx_11_0_arm64.whl (5.1 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

File details

Details for the file ferro_orm-0.16.0.tar.gz.

File metadata

  • Download URL: ferro_orm-0.16.0.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ferro_orm-0.16.0.tar.gz
Algorithm Hash digest
SHA256 ef38e596a31b7be2dfb478fa3400beeda6dfffa4fc450c1ee546a1ba453ca02b
MD5 31f2c2ff6eceec9e21b64cdca6ca0218
BLAKE2b-256 32358461e60e8810524930eebe69be6b9923a24e1d1647b9cf24ce806bf4b669

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferro_orm-0.16.0.tar.gz:

Publisher: release.yml on syn54x/ferro-orm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ferro_orm-0.16.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: ferro_orm-0.16.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 5.0 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ferro_orm-0.16.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 2f85a6979957c15740b64862cc5814141f6bba4e7ebbc5754dedf9c428922dce
MD5 6aee38ac1a6fcb145e3aef5f02c4cbca
BLAKE2b-256 126e5c15810522335c9c56517e24246cec0c50c6cb8915558eee163f01e02097

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferro_orm-0.16.0-cp39-abi3-win_amd64.whl:

Publisher: release.yml on syn54x/ferro-orm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ferro_orm-0.16.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ferro_orm-0.16.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 02e1a28934484391f9199171f3d2fc51d822a5e2ec599744e28af7d2d1c28f8a
MD5 dc1d8c90e31b2cdca60273213db82195
BLAKE2b-256 d670aaa7a41a1fa96a984bffcf0ad11a5f2d0dc6a4ceebd25a9792f2849cac3a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferro_orm-0.16.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on syn54x/ferro-orm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ferro_orm-0.16.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ferro_orm-0.16.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 af5616ab2c8bcb0ecd146d0f34e0b21cf8761ea784f8ed848c0e9489719241cd
MD5 2aba6657e393200eafcdc9c9c4c22c17
BLAKE2b-256 cddccb87e78a4a6187f304f0693a88786fcf04b85a4b932aa4b4f3c96a43cdd2

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferro_orm-0.16.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on syn54x/ferro-orm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ferro_orm-0.16.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ferro_orm-0.16.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fb36ad5275ad6b9564fc7b8902b7fef04daaf3075d8008e192bcee04856b4cd4
MD5 59fde98f2cbafd5b17281643f326b629
BLAKE2b-256 6a260c705360bf80d16eb43299302d5ba8b120cef23a872a069f3051ea9b3443

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferro_orm-0.16.0-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on syn54x/ferro-orm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.19.0

5 files

0.18.0

5 files

0.17.1

5 files

0.17.0

5 files

0.16.3

5 files

0.16.2

5 files

0.16.1

5 files

This release

0.16.0 This release

5 files

0.15.0

5 files

0.14.0

5 files

0.13.0

5 files

0.12.3

5 files

0.12.2

5 files

0.12.1

5 files

0.12.0

5 files

0.11.0

5 files

0.10.5

5 files

0.10.4

5 files

0.10.3

5 files

0.10.2

5 files

0.10.1

5 files

0.10.0

5 files

0.9.2

5 files

0.9.1

5 files

0.9.0

5 files

0.8.0

5 files

0.7.0

5 files

0.6.1

5 files

0.6.0

5 files

0.5.0

5 files

0.4.0

5 files

0.3.4

5 files

0.3.3

5 files

0.3.2

5 files

0.3.1

5 files

0.3.0

5 files

0.2.1

5 files

0.2.0

5 files

0.1.1

5 files

0.1.0

5 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page