Skip to main content

An opinionated architectural framework built on top of FastAPI that provides production-ready architecture, repository abstractions, scoped dependency injection, a secure dynamic query engine, and consistent transaction management.

Project description

ZCore Logo
A modest and practical architectural layer built on top of FastAPI.

License PyPI Build Status


What is ZCore?

ZCore is not a replacement for FastAPI; it is a modest and practical architectural layer built on top of it. While FastAPI provides the high-performance engine for handling HTTP requests, ZCore provides the "chassis"—a structured environment that solves common challenges in medium-to-large scale applications such as dependency management, transaction integrity, and data leakage prevention.

The framework focuses on Engineered Simplicity. It abstracts complex patterns like the Unit of Work and Scoped Inversion of Control into intuitive interfaces, allowing you to focus on your domain logic while the framework ensures that your database transactions are atomic and your sensitive data remains restricted based on the execution context.


Why Choose ZCore?

ZCore was designed to bridge the gap between "writing an endpoint" and "building a maintainable system."

Feature Standard FastAPI Challenge The ZCore Approach
Dependency Injection Manual wiring and complex Depends chains. Automated Scoped IoC with constructor injection.
Data Security Manual filtering of Pydantic models for different users. Context-aware Response Pruning via ResponseProjector.
Transactions Scatterred .commit() calls leading to partial failures. Centralized Unit of Work (UOW) for atomic operations.
Project Structure Inconsistent layouts across different teams. Modular Plugin System and standardized CLI scaffolding.
Search & Filter Writing repetitive boilerplate for every query. A secure, dynamic Search Engine with depth-limit protection.

The Request Lifecycle

Understanding how a request travels through ZCore is key to mastering its architecture. The following diagram illustrates the automated orchestration from the moment a request hits the server to the final pruned response.

ZCore Request Lifecycle


⚡ Quick Start

1. Installation

Set up a clean virtual environment and install ZCore with all optional dependencies:

python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install fastapi-zcore-framework[all]

2. Scaffold a Project

Initialize your project and generate a structured domain module using our command-line utility:

# Initialize project workspace
zc init product_api
cd product_api

# Scaffold a domain app with boilerplate templates
zc startapp products -t

3. Run the Development Server

Launch the local Uvicorn development server:

zc run

📚 Core Pillars at a Glance

  • ⚡ Scoped IoC Container: Manage object lifecycles (Singleton, Transient, or Scoped) with ease. Scoped dependencies are automatically cleared at the end of every HTTP request to prevent memory pollution.
  • 🛡️ Secure Search Engine: A dynamic query builder that supports nested filters and eager-loading, while automatically blocking access to restricted database columns based on security policies.
  • 🔗 Unit of Work (UOW): Ensures that business operations succeed or fail as a single unit. It coordinates database flushes and delays event dispatching until the transaction is successfully committed.
  • 🏗️ Modular Plugin System: Organize your application into decoupled domains. Each plugin manages its own lifecycle hooks (on_startup, on_shutdown) and can declare dependencies on other plugins.

📖 Documentation & Learning

To explore the full capabilities of ZCore, please refer to our online documentation:

ℹ️ NOTE: [Getting Started Guide] - Step-by-step tutorial to build your first service.

💡 TIP: [Architectural Concepts] - Understand the inner mechanics of our Scoped DI, UOW, and the Core Kernel.

⚠️ IMPORTANT: For production environments, remember to generate a secure secret key using the zc gensecret CLI command and update your .env configuration file.


ZCore is licensed under the Apache License 2.0. Built with ☕ and architectural rigor.

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

fastapi_zcore_framework-0.1.0b4.tar.gz (958.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastapi_zcore_framework-0.1.0b4-py3-none-any.whl (83.6 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_zcore_framework-0.1.0b4.tar.gz.

File metadata

File hashes

Hashes for fastapi_zcore_framework-0.1.0b4.tar.gz
Algorithm Hash digest
SHA256 744887b641b0f8570c0a58423999833cdebe3bcce4a447cc2ab7a74ab0d5afe1
MD5 fd45bd1cc33ba4c1503445cf5dda9dc5
BLAKE2b-256 f9727ab5db3d00daae99d4907119421adc2879cdfcb8671320e03d3ed8b44471

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastapi_zcore_framework-0.1.0b4.tar.gz:

Publisher: publish.yml on fastapi-zcore-framework/zcore

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastapi_zcore_framework-0.1.0b4-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_zcore_framework-0.1.0b4-py3-none-any.whl
Algorithm Hash digest
SHA256 5f269c3bdb9e6973259b096f50912868a9748020ec564ef16f4083bd1baccc2e
MD5 4cc42ff34d073a935435c050c64d31b8
BLAKE2b-256 003b59459fd1a2e7200758cd3651424bfdc2ef2445e922363052b6088fd3235b

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastapi_zcore_framework-0.1.0b4-py3-none-any.whl:

Publisher: publish.yml on fastapi-zcore-framework/zcore

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