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.0.tar.gz (170.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.1.0-cp39-abi3-win_amd64.whl (3.0 MB view details)

Uploaded CPython 3.9+Windows x86-64

ferro_orm-0.1.0-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.0-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.0-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.0.tar.gz.

File metadata

  • Download URL: ferro_orm-0.1.0.tar.gz
  • Upload date:
  • Size: 170.2 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.0.tar.gz
Algorithm Hash digest
SHA256 89f5f0bb45eb54aebdf8188cd3a7c2d6b2f777643c1ab95e6a4246d1b7c49c1b
MD5 70d2694c168bfbdd1a65f7b4bcdb0824
BLAKE2b-256 5cc5826f8596638a51cca023748299f5168baaae78c817b353dd67223da56d07

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: ferro_orm-0.1.0-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.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b3fa323a0eee1c668fc636351c72b8775e7e76932ba713ed9d413741ba03039a
MD5 46449e5a898a94986b948a09b65bb28f
BLAKE2b-256 ae8d5f29bda52d35203762a94eecb84d183274cc0969019f7cb6c636d121d654

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ferro_orm-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 782f1e2e49aa3f5276b51dc0695786b6c76f29efe2299fe13e634a4ac99f23f4
MD5 3d976d1c888e49372ee564f6410c9730
BLAKE2b-256 e09806f71d254fddb41d8ace866a32a676bfb8e25863a67dde8977733957e4f4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ferro_orm-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b12ccf2cb5ac187f6c7d85ad3f337b8133f9f216c6e91dec39fde98a285172f5
MD5 85cb4c9b4d41483f1c8bbdbf5426b935
BLAKE2b-256 e7760349a23cbaab0d53b409d1f07f0a5fc760325233fd8a97b13620e7233c95

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ferro_orm-0.1.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e6da4a8d2ff14cf32a20926fc6d811f4b1dfc896898f280ea82cf97c1683b0d2
MD5 c98c57f81c6ccac9188d50427c8349ef
BLAKE2b-256 aed1f87a902a1b64894b3bb438ba764b6ded93a958c3dd5cc0f5da79ae02b89b

See more details on using hashes here.

Provenance

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