Metadata-Version: 2.4
Name: fastapi-extra
Version: 0.9.2
Summary: extra package for fastapi.
Author-email: Ziyan Yin <408856732@qq.com>
License: BSD-3-Clause
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Internet
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi<0.142.0,>=0.141.0
Requires-Dist: httpx2<2.13.0,>=2.12.0
Requires-Dist: pydantic-settings>=2.15.0
Requires-Dist: sqlmodel>=0.0.39
Provides-Extra: redis
Requires-Dist: redis; extra == "redis"
Provides-Extra: scheduler
Requires-Dist: apscheduler; extra == "scheduler"
Provides-Extra: mysql
Requires-Dist: asyncmy; extra == "mysql"
Provides-Extra: pgsql
Requires-Dist: asyncpg; extra == "pgsql"
Provides-Extra: oracle
Requires-Dist: oracledb; extra == "oracle"
Provides-Extra: aiomysql
Requires-Dist: aiomysql; extra == "aiomysql"
Dynamic: license-file

**FastAPI Extension Suite**

---

### Project Overview

**fastapi_extra** is a feature-rich enhancement extension library for FastAPI (Python >= 3.12, BSD-3-Clause license) designed to provide an out-of-the-box, enterprise-grade framework on top of FastAPI. 
[[Documentation](docs/README.md)]

---

### Key Features

* **Performance Optimization** — Uses monkey-patching on FastAPI's internal argument parsing and router matching logic with built-in caching; includes Cython-native implementations for Snowflake ID generation and high-speed URL parsing.
* **Complete ORM Layer** — Built on top of SQLModel (SQLAlchemy + Pydantic) with a `SQLBase` base class that incorporates Snowflake IDs, optimistic locking (versioning), soft deletes, and automatic timestamps.
* **Unified API Responses** — Features an Alibaba Cloud-style `ResultEnum` (120+ pre-defined status codes) and generic `APIResult[T]` response models for standardized API outputs.
* **SQL Template Engine** — Supports external `.sql` files with an `@Mapped` decorator for annotation-driven query execution (`execute`, `fetch_all`, `fetch_one`).
* **Dependency Injection Architecture** — Provides `AbstractComponent` and `AbstractService` abstractions with singleton management and `ContextVar` context passing, seamlessly integrating with FastAPI's `Depends`.
* **Redis Cache Integration** — Async connection pool management with ready-to-use Redis dependency injection.
* **Scheduled Tasks** — Integrated async task runner built on APScheduler, supporting decorator-based job registration with full dependency injection support inside task functions.
* **TOML-Driven Configuration** — Multi-layered settings loading (TOML > Env > Defaults > Secrets) powered by `pydantic-settings`.

---

### Tech Stack

* **Python** >= 3.12
* **FastAPI** >= 0.141.0
* **SQLModel** >= 0.0.39
* **Pydantic Settings** >= 2.15.0
* **Cython** (for performance-critical modules)

---

### Target Use Case

Ideal for building high-performance RESTful API services in enterprise environments, offering a complete end-to-end toolkit covering database connection pooling, ORM operations, caching, scheduled jobs, and standardized API responses.
