Skip to main content

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

Project description

Ferro: The Pydantic x Rust ORM

PyTest Ruff MkDocs 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.10.4.tar.gz (465.5 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.10.4-cp39-abi3-win_amd64.whl (4.4 MB view details)

Uploaded CPython 3.9+Windows x86-64

ferro_orm-0.10.4-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.0 MB view details)

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

ferro_orm-0.10.4-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.8 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

ferro_orm-0.10.4-cp39-abi3-macosx_11_0_arm64.whl (4.5 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: ferro_orm-0.10.4.tar.gz
  • Upload date:
  • Size: 465.5 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.10.4.tar.gz
Algorithm Hash digest
SHA256 123706919282e71bc6a9a16c39728e11f093b6e2726d944ae371ecb07134c5da
MD5 19e7252d85e3e28d38ca674633a401ef
BLAKE2b-256 e45903f6a90c0ef20602874beabf9d550db76a37392b3b1dc05a5f21a6f62b38

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: ferro_orm-0.10.4-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 4.4 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.10.4-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b9ff45622d7c1f0e891576bebdda255230b5f9846b55a46dd09e797f34371d3e
MD5 4e2b37a30917f74a2fff5c75bfbc345d
BLAKE2b-256 8ed67239e01ac8bc94c411f7382d4029b45e27c605bb1d17ed4ee9f9f00c368d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ferro_orm-0.10.4-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cfdc1730d50d40a662915b2e436615b21edb419b3aa1d8d9d7b08b600891aadd
MD5 fd3f430284674d2e2ea303f95c8be2be
BLAKE2b-256 25f0abe4ca7c6d592abda9651a2d258c377ea0ceafcf07cc6e6498c490f13f2b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ferro_orm-0.10.4-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 dd49ce26667df7eacbc47ad484bed14442bd9c4326bf80912b9bfd1af2bf1b02
MD5 a88545a6c9feba5f1e1dc96982af696b
BLAKE2b-256 3e5825f076506e07b3e1e3cd549a228567969f077969a18bd57c0a2017bfa647

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ferro_orm-0.10.4-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cba00683c3adeab392f84e96d36b10838083e18c45c390acb00a60efe508d9d1
MD5 7bc64f91ceda0169604d2fd42543e34b
BLAKE2b-256 f467980b05afdb8fe16fe47768d44b6f2e4e3814a7445e836632e1e4b456dd2a

See more details on using hashes here.

Provenance

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