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]"

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.3.2.tar.gz (259.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.3.2-cp39-abi3-win_amd64.whl (3.9 MB view details)

Uploaded CPython 3.9+Windows x86-64

ferro_orm-0.3.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.4 MB view details)

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

ferro_orm-0.3.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.3 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

ferro_orm-0.3.2-cp39-abi3-macosx_11_0_arm64.whl (4.0 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: ferro_orm-0.3.2.tar.gz
  • Upload date:
  • Size: 259.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.3.2.tar.gz
Algorithm Hash digest
SHA256 408dd458aa95f4dd05e2aabdd15225066c79324f3196d2fb4ae190bdd3925668
MD5 eee0689b21e8d517231dde6797484d66
BLAKE2b-256 df84d9fe63f93d3ed5089e02998bbd1bf0faef02ae887c091255b3a3a286e408

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: ferro_orm-0.3.2-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 3.9 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.3.2-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 832843b977d495c7d1009f9239a4cfd224eb00711f054cd8a4f9b0d8048f071c
MD5 128b4a0012e971808193d17b57eaec7e
BLAKE2b-256 7f43a937ef177f85c11592b19435d8f5e6611d0ce6faa9222ad21e7638797137

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ferro_orm-0.3.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 099910712b96f4b254018dd4414de3eaf2a2770e6bdc85005dfbc1af3925a06d
MD5 ac06c385f5c534319f54a79527498e57
BLAKE2b-256 48964e0e13415fdd80022ed861e16b5815772b37fd10bb4e57b0630f2c3dafc4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ferro_orm-0.3.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c856bc240a9ed77f1b820d711a3a32bc9ee13677c8d876bbf0e5a6634188a8e4
MD5 3b08d640bba1cf3c5bf5962b4c91174a
BLAKE2b-256 852c0cf6d43f68749fc18705cc4167d623f58b39f756d2fa778f2833899008c4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ferro_orm-0.3.2-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a3ee23bd98a0959f38c92fcf2b5abc10deaf504641e4aaf865df42f56946b299
MD5 54531a796db7726f1821c74ab9320cd2
BLAKE2b-256 6f7b66129f9803d281442ffbc4a619241ea5f49e743d35a0d67236217c5881f6

See more details on using hashes here.

Provenance

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