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 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.2.1.tar.gz (242.2 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.2.1-cp39-abi3-win_amd64.whl (3.1 MB view details)

Uploaded CPython 3.9+Windows x86-64

ferro_orm-0.2.1-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.2.1-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.2.1-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.2.1.tar.gz.

File metadata

  • Download URL: ferro_orm-0.2.1.tar.gz
  • Upload date:
  • Size: 242.2 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.2.1.tar.gz
Algorithm Hash digest
SHA256 4de73f9f2a4796de3b4e808cb937ab866f0bc8b2562cd0d690ce2195396ec2b0
MD5 a423040a07b43ef7189c9c085ac3dd7c
BLAKE2b-256 ea051049159cc304be209477463da794cebc0181c507ed38ca210e29a6e9addb

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: ferro_orm-0.2.1-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 3.1 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.2.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 4e01dbed66d0b2bda88893b66c80bec3234cd09dd64d1d293507150b90c17884
MD5 42b91fffd032e72b972ab8198f910857
BLAKE2b-256 7d05004f164c2320e31e30f300b12d102b4656ece2486c3784805d72a56d3cd5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ferro_orm-0.2.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ac7c41395950490cd2d00a85b3bf268b1a20c515496530743216872983d729f3
MD5 87671c9a78502d644edfeb5c67118fc1
BLAKE2b-256 0ea8112f2797e21f97b4b8d81ee174343aa8eba8ce146630613cfb315090945d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ferro_orm-0.2.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6a18f2baaa27cad4fb4051fa86dff5a994c258984fb6f11277cb172b4c54904d
MD5 9db40a95d7f65628d8d3d354d4848519
BLAKE2b-256 26dc32e9632bd81287e7ded4dde39b0390b1f0dd2e34fbd975e95ea4cdad5675

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ferro_orm-0.2.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7cbf43239122047d2bf39ae6ba1f20ae0d52c9c86158829c1e1d1a44a45a05ed
MD5 cde38273584fa7ef584da67bb9be55ef
BLAKE2b-256 1d6b30fe3da416b525e749334488874090b86571f0e2fca7557150270f359730

See more details on using hashes here.

Provenance

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