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

Uploaded CPython 3.9+Windows x86-64

ferro_orm-0.3.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB view details)

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

ferro_orm-0.3.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.3.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.3.1.tar.gz.

File metadata

  • Download URL: ferro_orm-0.3.1.tar.gz
  • Upload date:
  • Size: 258.6 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.1.tar.gz
Algorithm Hash digest
SHA256 6de93e51dabdbb54ad55edc2eff177fbeafb671cac301465834824c7076d26f9
MD5 99923f588e7ba8a746409b731a770e2d
BLAKE2b-256 fdd8c7c2b1a25a81a4716d4659436f072f4d12983a124ff364e2b97130813654

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: ferro_orm-0.3.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.3.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 015992210893efdbe729e85fef5b2e4b9be3013fedb7a1337c8fb6deb755e650
MD5 3721d8c4fa7e108c97f2ac64fed00757
BLAKE2b-256 a3ae55386351761a532b99a94ad13c328467529be1adead085959edc787d7c84

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ferro_orm-0.3.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0b64b298beffd236b6ee2d3af96161cc9c38571663b923760c0c7b9eed2ce33f
MD5 ba3a7f6b801427018aececcaff846b71
BLAKE2b-256 bcb3ed90ead6de5484af120607123b631d4d1583ba415220c0716273b96a2762

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ferro_orm-0.3.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 43dd6dbb936c4a7c9015efdaf728d44fe50b2d718322c7ba7eb3fa75c0a3164c
MD5 7c5dcfafb2fb39a732c6682d335ddd47
BLAKE2b-256 ddbe6b600d828ce99be680fdb038c168208bf0236501eb8c92ccb9ddd06416a5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ferro_orm-0.3.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 35939b4f2759ab10a0b68c6565e00a1b00a8dc8154a34c0368451a83b8bbde39
MD5 372935a4916d723a7877a71e0d959035
BLAKE2b-256 947e8f2f649ec249687fc04daa19a8afbe86e9f4f50ee31638a0d55fd24515c6

See more details on using hashes here.

Provenance

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