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.9.1.tar.gz (419.3 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.9.1-cp39-abi3-win_amd64.whl (4.3 MB view details)

Uploaded CPython 3.9+Windows x86-64

ferro_orm-0.9.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.9 MB view details)

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

ferro_orm-0.9.1-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.9.1-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.9.1.tar.gz.

File metadata

  • Download URL: ferro_orm-0.9.1.tar.gz
  • Upload date:
  • Size: 419.3 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.9.1.tar.gz
Algorithm Hash digest
SHA256 8467c6f12705b9b2fb505c76b30dd1e3b329ce5e3218b9651649417dfaedf9f8
MD5 b29a7882c4db878c2f0bbb267ba8f3b8
BLAKE2b-256 0c94a9f5681c2290893ca84f9de4d9dfd10f06a251b112fa273c4e61b6920bf4

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: ferro_orm-0.9.1-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 4.3 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.9.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 4b8c3cf543261f8f680cc896eb6bc94eeaf6e39ec20ab127ceb2f3cfcea79e31
MD5 c4d7fe89347fd1e707d217bfa8043a5f
BLAKE2b-256 2a6afad451b29607fbade4b63d141f1b99cc2ed6a2eb44956fe4d5c1736e648a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ferro_orm-0.9.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2e67a4b78b15f8f92c2d6b41623d35001ba51131c6e0790796c610498bdafb54
MD5 d8ddcd4fda76547b2a7b7bdb4ca51222
BLAKE2b-256 272c1e5ad421a9f9dff00e104e380871e43a76a2f3accfe9669b194b6fd9df3d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ferro_orm-0.9.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 874718fee29788ba66392d3b05585e4ee31c84367dda3ea4fbc6f10dc67605eb
MD5 1e6648fcb413638c086bbd3cd7ad828d
BLAKE2b-256 03d60e71eca665491bd0af0603af6a9f4728a67b899ba15e9668523ba4a86d2e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ferro_orm-0.9.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0d467b64c03f4a72b7001ec8bd1157127c86a4e400eac73ef66ed832e4bda61c
MD5 1df0ad76459eb1ad46b3fe6407661712
BLAKE2b-256 a7430f62256fe9b32bb46bff46a370cbeb47051cb6652a780302385c0b6ba4cb

See more details on using hashes here.

Provenance

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