⚡ Ferrox-Py (Core Framework)
A Python 3.11+ Framework for Enterprise Server-Side Development
Inspired by the robustness of Rust-Ferrox, bringing Inversion of Control, Modularity, and Onion Architecture to the Python ecosystem.
1. Overview (What does this do?)
ferrox-py is the core foundation of the Ferrox ecosystem for Python. It provides an Inversion of Control (IoC) container, a Dependency Injection (DI) system, and the fundamental structure required to develop robust, scalable, and decoupled backend applications in Python. It goes beyond being just a web framework; it serves as a complete application lifecycle manager that simultaneously supports REST APIs, GraphQL, background jobs, and event queues.
2. Philosophy (Why does it exist?)
Modern backend development in Python is often plagued by monolithic scripts or overly permissive frameworks, causing architectural decisions to fragment over time. Ferrox-Py was created to mitigate the technical debt inherent in complex projects by enforcing:
- Strict Decoupling between domain logic (Business Layer) and the transport protocol (HTTP, gRPC, Queues).
- Secure State Management through centralized IoC containers.
- Rigorous Validation upon entry (leveraging Pydantic).
- Mitigation of Abuse by strictly separating side effects and enforcing robust architectural boundaries.
3. Target Audience (Who is it for?)
This framework is specifically designed for Data Platforms, Enterprise SaaS, and Microservices Architectures where security, code predictability, and long-term maintainability are absolutely critical. If you need a system that seamlessly scales alongside your team without degrading into a convoluted "spaghetti code" architecture, Ferrox-Py is the ideal choice.
4. Architecture (How does it work?)
Ferrox-Py faithfully adopts the 7-Layer Onion Request Pipeline from the original Ferrox ecosystem:
- Security & Headers: Initial interception and sanitization of incoming requests.
- Active Defense & Rate Limiting: Preemptive protection against system abuse.
- Auth Guards: Extraction and strict validation of authentication tokens (JWT/PASETO).
- RBAC & ZK Proofs: Rigorous Role-Based Access Control and zero-knowledge mechanisms.
- Validation Pipe: Formal checking of the DTO (Data Transfer Object) payload.
- Controller Layer: Translation of the transport protocol into the specific domain language.
- Business Service / CQRS: Execution of domain logic, state mutations, and persistence.
5. Installation / Setup
To run ferrox-py, ensure you have an environment with Python 3.11+. No prior configuration is required, but it is highly recommended to use a virtual environment.
# Example local installation (development mode)
pip install -e .
The project also exposes the ferrox CLI for utilities and basic administrative tasks.
6. Quickstart (Usage)
Below is a minimal setup using Python 3.11+ to initialize the application and its dependency container:
from ferrox_py.core.app import FerroxApp
from ferrox_py.core.container import Container
def main():
# Initialize the IoC container
container = Container()
# Register your services and controllers here
# container.register("my_service", MyService)
# Build and start the Ferrox application
app = FerroxApp(container)
app.start()
if __name__ == "__main__":
main()
7. Ecosystem Integration
The Core module is intentionally designed to act as a hub that can be seamlessly extended by specialized packages:
- 🛠️ ferrox-py-utils: Integration for ETL tools, data pipelines, and connectors (e.g., S3, CSV).
- 🔒 ferrox-py-auth: Integrates IAM, SSO, RBAC, and GDPR compliance features directly into the Auth Guards layer.
- 💳 ferrox-py-commerce: Interfaces with Stripe/PayPal webhooks and enforces idempotency in the Transaction State.
Metadata
Release files for ferrox-py 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ferrox_py-1.1.0.tar.gz | 60.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ferrox_py-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 125.8 kB
Release files / ferrox_py-1.1.0.tar.gz
| Download URL | ferrox_py-1.1.0.tar.gz |
|---|---|
| Size | 60.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
091366a02398c60f67047f803dbc52d0e8307bc3c9df3d4f3f2dd9d4e0fb40b4
|
|
BLAKE2b-256 checksum How to use checksums |
f9d02690e25972da0c19d34dcc617aa7e83713cd0a2ffbb26bc5ecd7a38c94f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.2
|
Release files / ferrox_py-1.1.0-py3-none-any.whl
| Download URL | ferrox_py-1.1.0-py3-none-any.whl |
|---|---|
| Size | 65.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b71171ed4546aab6484974d715935b0ef92c7ec9c524578c8e615119421721db
|
|
BLAKE2b-256 checksum How to use checksums |
4d7c5fd1cc76f2100b81be5eca1aa222169c9e60f5b618fa0039207d5a864c38
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.2
|