Skip to main content

A high-performance, Rust-backed ORM for Python.

Project description

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 as runtime backends. Named multi-database routing and custom connection-pool kwargs are planned, but not part of the current public API.

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
    active_users = await User.where(User.is_active == True).all()
    print(f"Found {len(active_users)} active users.")

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

Project details


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.12.0.tar.gz (544.0 kB 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.12.0-cp39-abi3-win_amd64.whl (4.6 MB view details)

Uploaded CPython 3.9+Windows x86-64

ferro_orm-0.12.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.2 MB view details)

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

ferro_orm-0.12.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.1 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

ferro_orm-0.12.0-cp39-abi3-macosx_11_0_arm64.whl (4.7 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for ferro_orm-0.12.0.tar.gz
Algorithm Hash digest
SHA256 2bef1695850bed1c9d2eb9fd33bf5959e0af6aa0c676ae1cc591aad42dfdf678
MD5 d6b902cd97b4cdd2b847a6b5f3120b0b
BLAKE2b-256 9f2742326ef1278b6291568bf77fad77e8b927fade1c4f246b1528a04f3ee1f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferro_orm-0.12.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.12.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: ferro_orm-0.12.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 4.6 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.12.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b4dca9af80fc46bf0184f60986624a5518f9d42efede87e5f999d3ae960a0829
MD5 cd000306f5f57cbf7f65b4ef45b1c1e1
BLAKE2b-256 4d869a722811c6e8096b1f79b0cb1e8bbe369301389b8c78d5f9b60e92548df7

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferro_orm-0.12.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.12.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ferro_orm-0.12.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b06eb721bb90df0e0ece3dd248a0819036c0a821282474d62b93217bbd10e5f5
MD5 08cabc86e39861d7636cf6ef88a51c1c
BLAKE2b-256 2fe31bc7e7859670ef87de9fb37a2c3a91c5bd5e15d24a3410e45cd26937d445

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferro_orm-0.12.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.12.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ferro_orm-0.12.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 66a92aa11f7780d47773a10762096d4a8f5680bd169726394e78c624a3e353f6
MD5 afb4f2671983f1a59a554200b6703ea7
BLAKE2b-256 a42ce9d76b2861f420b26e20446069eba32dfcebb66c0d3ac8cae86a27495b41

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferro_orm-0.12.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.12.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ferro_orm-0.12.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8d195833dd1216f26f5d4194fb5e7d69e3d8c5f6045ac01e6b3abc00cf2d48d0
MD5 a88beb60cf14eeca29be75a2ffab2f31
BLAKE2b-256 8914c5879d70c911c7449ee52403f7cf93d2109829e0ae175687d8e179a601e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferro_orm-0.12.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.

Supported by

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