Skip to main content

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

Project description

Ferro: A High-Performance Rust-Backed Python ORM

PyTest Ruff MkDocs UV Rust Python PyPI License Downloads Codecov Issues

Ferro is a high-performance, asynchronous ORM for Python, built with a Rust-backed core engine. It combines the ergonomics of Pydantic models with 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 typing import Annotated
from ferro import Model, FerroField, connect

class User(Model):
    id: Annotated[int, FerroField(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.1.0rc2.tar.gz (181.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.1.0rc2-cp39-abi3-win_amd64.whl (3.0 MB view details)

Uploaded CPython 3.9+Windows x86-64

ferro_orm-0.1.0rc2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.5 MB view details)

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

ferro_orm-0.1.0rc2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.4 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

ferro_orm-0.1.0rc2-cp39-abi3-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

File details

Details for the file ferro_orm-0.1.0rc2.tar.gz.

File metadata

  • Download URL: ferro_orm-0.1.0rc2.tar.gz
  • Upload date:
  • Size: 181.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ferro_orm-0.1.0rc2.tar.gz
Algorithm Hash digest
SHA256 643ce76028bb17ed30c7d30300f172832b434e68ab46849bd3a574a6de28d760
MD5 e59e20112e1141c7bd6743924332dc03
BLAKE2b-256 d62853123abac0219fa5bcd6837cd72ce419ee9bbbc39c3df309b6ca669f46d4

See more details on using hashes here.

Provenance

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

Publisher: publish.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.1.0rc2-cp39-abi3-win_amd64.whl.

File metadata

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

File hashes

Hashes for ferro_orm-0.1.0rc2-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 d31e7ee377a1c44ce43b53ae7f68e53377776909cfd9f8f1a8b36bb8f2db52cf
MD5 89b7f24643cc0c5d2369c1d1c87a6ad6
BLAKE2b-256 fdfe17a6d3ea983a76fac91a2f46d59620ff32fb9f4e4c3304bcc6fcfa929fd7

See more details on using hashes here.

Provenance

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

Publisher: publish.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.1.0rc2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ferro_orm-0.1.0rc2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 895e079516bb57a37879d39c90f9e33f36a646fea370dac5ffcc1851cfb6313b
MD5 ca471b42656d81899153567ff064df9d
BLAKE2b-256 7f26c2c51b47685b3cdc67197d7bd0d37fde2e2893a3ad61cbf3e98adf6ac233

See more details on using hashes here.

Provenance

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

Publisher: publish.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.1.0rc2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ferro_orm-0.1.0rc2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9edea27b05569b851869ad00cb1e78586bb4434bd76aafbe143277bc6e8856d3
MD5 ce2fb6c8294f1397d418218eccb69288
BLAKE2b-256 5a4ae45461e6f909f66cfd07c10ba5aecf7773a3bd9e523a9f78ce5d65e1c827

See more details on using hashes here.

Provenance

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

Publisher: publish.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.1.0rc2-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ferro_orm-0.1.0rc2-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f1a1a029392ef0968a72578330950c299b43ddf3835f98dc8db153014cea940a
MD5 92b4dd1efeae918bd41aab4a0c2fe649
BLAKE2b-256 f79655f9f0af6e8a27756734147c24544ead744e0172ff06e40d88054a4bb6f0

See more details on using hashes here.

Provenance

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

Publisher: publish.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