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.0b2.tar.gz (957.7 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.0b2-py3-none-any.whl (82.5 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for fastapi_zcore_framework-0.1.0b2.tar.gz
Algorithm Hash digest
SHA256 16a6c3c26bbebee06ebcfc03fb8b4ddf7912103ee508507f0ed7048dad4c6ec6
MD5 b5c19512063a425e26d2378740e209e4
BLAKE2b-256 212f5c20914f6f0bb70fae0e0388f0341fafe71e950e9273f1a269d1ef86b1ea

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for fastapi_zcore_framework-0.1.0b2-py3-none-any.whl
Algorithm Hash digest
SHA256 92bd7b417fa7d0a3f07e03114a06111ca3b2617210a06a8cbb56c85d4da26b6a
MD5 6438fb8cb53795d81c2098864ab6ff4e
BLAKE2b-256 10bf208f86dbe92de19820916c2011283c6b275f0b047d78cf54243aa88e80b7

See more details on using hashes here.

Provenance

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