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.0b3.tar.gz (958.3 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.0b3-py3-none-any.whl (83.1 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for fastapi_zcore_framework-0.1.0b3.tar.gz
Algorithm Hash digest
SHA256 1aa424fe386ef35089b4954cb2780ad342e12ddd21e994e93f30ce3464f72f9c
MD5 57e91cabc826b448476b955b5f77b56a
BLAKE2b-256 f341408c6ffde1327ca39ea0e35852c3a3d24bc739d32cb847fc79d80fdede47

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastapi_zcore_framework-0.1.0b3.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.0b3-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_zcore_framework-0.1.0b3-py3-none-any.whl
Algorithm Hash digest
SHA256 c9fa4fe9b8afd69df171173876eda64cc79abd29ac964345520f408e78497b6f
MD5 2493d51d617e0535b8331a5b8b894bb5
BLAKE2b-256 570cf5ecf5de6387d2bfaa771fe05a67e0cd38d100f76a97b2adc0149a830c43

See more details on using hashes here.

Provenance

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