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.0b5.tar.gz (964.8 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.0b5-py3-none-any.whl (83.8 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for fastapi_zcore_framework-0.1.0b5.tar.gz
Algorithm Hash digest
SHA256 7f80f951dbb3a642eafd0714e1a9b24ed4c9b5d15b3b68ee57a9f49a69960306
MD5 9766c27964902fe71129919dc88a2833
BLAKE2b-256 d3c2c3808fd7f212125542d42f0bec1b7458cefa236c20fce6ebdea6f84c7d04

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for fastapi_zcore_framework-0.1.0b5-py3-none-any.whl
Algorithm Hash digest
SHA256 0345a5ffaeab979403c733fde532fdb67b4c6baf5f884169382660f8acbe7ce4
MD5 76e972bac8bcfdb1ec097bdda415b036
BLAKE2b-256 9621199f76338105f43aceebc95ad5c489784516c425810237e732b352e75c83

See more details on using hashes here.

Provenance

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