Metadata-Version: 2.4
Name: enterpipelite
Version: 1.0.0a2
Summary: Decorator-first FastAPI toolkit for REST endpoints with normalized responses and plugin-ready integrations.
Project-URL: Homepage, https://github.com/abbas-najafian/enterpipelite
Project-URL: Repository, https://github.com/abbas-najafian/enterpipelite
Project-URL: Issues, https://github.com/abbas-najafian/enterpipelite/issues
Project-URL: Changelog, https://github.com/abbas-najafian/enterpipelite/blob/main/CHANGELOG.md
Author: EnterPipeLite contributors
License-Expression: MIT
License-File: LICENSE
Keywords: api,decorators,fastapi,openapi,plugins,rest
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: FastAPI
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: fastapi<1,>=0.115.0
Requires-Dist: httpx<1,>=0.27.0
Requires-Dist: pydantic<3,>=2.7.0
Provides-Extra: all
Requires-Dist: aiokafka<1,>=0.10.0; extra == 'all'
Requires-Dist: aiomysql<1,>=0.2.0; extra == 'all'
Requires-Dist: aioodbc<1,>=0.5.0; extra == 'all'
Requires-Dist: asyncpg<1,>=0.29.0; extra == 'all'
Requires-Dist: pyjwt[crypto]<3,>=2.9.0; extra == 'all'
Requires-Dist: redis<7,>=5.0.0; extra == 'all'
Requires-Dist: sentry-sdk<3,>=2.0.0; extra == 'all'
Requires-Dist: uvicorn<1,>=0.30.0; extra == 'all'
Provides-Extra: auth
Requires-Dist: pyjwt[crypto]<3,>=2.9.0; extra == 'auth'
Provides-Extra: databases
Requires-Dist: aiomysql<1,>=0.2.0; extra == 'databases'
Requires-Dist: aioodbc<1,>=0.5.0; extra == 'databases'
Requires-Dist: asyncpg<1,>=0.29.0; extra == 'databases'
Provides-Extra: dev
Requires-Dist: build<2,>=1.2.1; extra == 'dev'
Requires-Dist: check-wheel-contents<1,>=0.6; extra == 'dev'
Requires-Dist: mypy<3,>=1.10.0; extra == 'dev'
Requires-Dist: pip-audit<3,>=2.7; extra == 'dev'
Requires-Dist: pyjwt[crypto]<3,>=2.9.0; extra == 'dev'
Requires-Dist: pytest-asyncio<2,>=0.23.0; extra == 'dev'
Requires-Dist: pytest-cov<7,>=5; extra == 'dev'
Requires-Dist: pytest<10,>=8.2.0; extra == 'dev'
Requires-Dist: ruff<1,>=0.5.0; extra == 'dev'
Requires-Dist: twine<7,>=5; extra == 'dev'
Requires-Dist: uvicorn<1,>=0.30.0; extra == 'dev'
Provides-Extra: jwt
Requires-Dist: pyjwt[crypto]<3,>=2.9.0; extra == 'jwt'
Provides-Extra: kafka
Requires-Dist: aiokafka<1,>=0.10.0; extra == 'kafka'
Provides-Extra: mssql
Requires-Dist: aioodbc<1,>=0.5.0; extra == 'mssql'
Provides-Extra: mysql
Requires-Dist: aiomysql<1,>=0.2.0; extra == 'mysql'
Provides-Extra: postgres
Requires-Dist: asyncpg<1,>=0.29.0; extra == 'postgres'
Provides-Extra: redis
Requires-Dist: redis<7,>=5.0.0; extra == 'redis'
Provides-Extra: security
Requires-Dist: pyjwt[crypto]<3,>=2.9.0; extra == 'security'
Provides-Extra: sentry
Requires-Dist: sentry-sdk<3,>=2.0.0; extra == 'sentry'
Provides-Extra: server
Requires-Dist: uvicorn<1,>=0.30.0; extra == 'server'
Description-Content-Type: text/markdown

# EnterPipeLite

[![Python](https://img.shields.io/badge/python-3.11--3.14-blue.svg)](https://www.python.org/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![Status: Alpha](https://img.shields.io/badge/status-alpha-orange.svg)](https://github.com/abbas-najafian/enterpipelite/blob/main/CHANGELOG.md)

EnterPipeLite is a typed, decorator-first toolkit for building REST APIs on FastAPI. It provides
OpenAPI generation, normalized response envelopes, validation, named authentication and rate
limiting, and plugin-shaped database, HTTP, Redis, Kafka, cache, and observability integrations.

> **Alpha prerelease:** `1.0.0a2` is intended for evaluation. Public APIs may still evolve before
> stable `1.0.0` according to the documented deprecation policy.

[راهنمای فارسی](README.fa.md) · [Repository](https://github.com/abbas-najafian/enterpipelite) · [Issues](https://github.com/abbas-najafian/enterpipelite/issues)

## Installation

Install the prerelease from PyPI after it is published:

```bash
python -m pip install --pre enterpipelite
```

Optional integrations are installed through extras:

```bash
python -m pip install --pre "enterpipelite[server]"
python -m pip install --pre "enterpipelite[security]"
python -m pip install --pre "enterpipelite[redis]"
python -m pip install --pre "enterpipelite[kafka]"
python -m pip install --pre "enterpipelite[postgres]"
python -m pip install --pre "enterpipelite[mysql]"
python -m pip install --pre "enterpipelite[mssql]"
```

Supported Python versions: **3.11 through 3.14**.

## Minimal app

```python
from enterpipelite import EnterPipeApp, get
from enterpipelite.core.registry import EndpointRegistry
from enterpipelite.resources import ResourceRegistry
from enterpipelite.security import SecurityRegistry

registry = EndpointRegistry()

@get("/hello", registry=registry)
async def hello(name: str = "world"):
    return {"message": f"Hello {name}"}

app = EnterPipeApp(
    registry=registry,
    resource_registry=ResourceRegistry(),
    security_registry=SecurityRegistry(),
    auto_configure_resources=False,
    auto_configure_security=False,
).build()
```

Run it from a source checkout:

```bash
python -m uvicorn examples.basic_app:app --reload --env-file .env
```

Open `/docs` for Swagger UI and `/openapi.json` for the generated schema. JSON responses use a
consistent envelope containing `success`, `status_code`, `data`, `error`, and execution metadata.

## Features

- Concise `@get`, `@post`, `@put`, `@patch`, `@delete`, and `@ep` endpoint declarations.
- Accurate OpenAPI for signatures, decorator-declared bodies, security, and rate-limit metadata.
- Handler, declarative operation, and hybrid endpoint modes.
- PostgreSQL, MySQL, SQL Server, outbound HTTP, Redis, Kafka, cache, and Sentry providers.
- Named API-key, JWT, OIDC resource-server, and external authentication providers.
- Multiple named provider instances, with at most one auth provider selected per endpoint.
- Versioned HMAC API-key digests, consumer credentials, rotation, and revocation.
- In-memory and Redis fixed-window rate limiting.
- Stable typed contracts for external resource and authentication plugins.

## Security model

Secrets and concrete credentials belong in environment variables. Source and JSON configuration
reference environment-variable names through fields such as `dsn_env`, `url_env`, `api_key_env`,
`pepper_env`, and `verification_key_env`. API-key consumer stores retain versioned HMAC digests,
not plaintext keys. OIDC support validates bearer access tokens as a resource server; it does not
implement browser login or authorization-code flows.

Generate an API-key digest without putting the key on the command line:

```bash
python -m enterpipelite.security hash-api-key --pepper-env ENTERPIPE_API_KEY_PEPPER
```

See [SECURITY.md](SECURITY.md) before reporting a vulnerability.

## Documentation

English:

- [Quickstart](docs/en/quickstart.md)
- [Concepts](docs/en/concepts.md)
- [Security](docs/en/security.md)
- [API keys and rotation](docs/en/api-keys.md)
- [JWT and OIDC](docs/en/jwt-oidc.md)
- [Rate limiting](docs/en/rate-limiting.md)
- [Resources and plugins](docs/en/plugins.md)
- [Release and compatibility policy](docs/en/release-policy.md)
- [Docker and Kubernetes deployment](docs/en/deployment.md)

Persian / فارسی:

- [شروع سریع](docs/fa/quickstart.md)
- [مفاهیم](docs/fa/concepts.md)
- [امنیت](docs/fa/security.md)
- [API key و rotation](docs/fa/api-keys.md)
- [JWT و OIDC](docs/fa/jwt-oidc.md)
- [محدودسازی نرخ](docs/fa/rate-limiting.md)
- [Resourceها و pluginها](docs/fa/plugins.md)
- [سیاست انتشار و سازگاری](docs/fa/release-policy.md)
- [استقرار Docker و Kubernetes](docs/fa/deployment.md)

External plugin starters are available in
[`templates/resource_provider`](templates/resource_provider) and
[`templates/auth_provider`](templates/auth_provider).

## Development

```bash
python -m pip install -e ".[dev,all]"
python -m ruff check .
python -m ruff format --check .
python -m mypy enterpipelite
python -m pytest --ignore=tests/integration
python -m build
```

Integration tests require explicitly configured disposable services. Never point them at shared or
production databases.

## Project policy

- [Changelog](CHANGELOG.md)
- [Contributing](CONTRIBUTING.md)
- [Support](SUPPORT.md)
- [Code of Conduct](CODE_OF_CONDUCT.md)
- [Security Policy](SECURITY.md)
- [MIT License](LICENSE)

Canonical project links: [repository](https://github.com/abbas-najafian/enterpipelite),
[issue tracker](https://github.com/abbas-najafian/enterpipelite/issues), and
[changelog](https://github.com/abbas-najafian/enterpipelite/blob/main/CHANGELOG.md).
