Metadata-Version: 2.4
Name: framework-m-standard
Version: 0.6.0
Summary: Default adapters for Framework M (SQLAlchemy, Redis, Litestar)
Author: Framework M Contributors
License: Apache-2.0
Requires-Python: >=3.12
Requires-Dist: aioboto3>=15.5.0
Requires-Dist: aiofiles>=25.1.0
Requires-Dist: alembic>=1.13.0
Requires-Dist: argon2-cffi>=23.1.0
Requires-Dist: asyncpg>=0.29.0
Requires-Dist: authlib>=1.3.0
Requires-Dist: elasticsearch>=8.0.0
Requires-Dist: framework-m-core>=0.9.0
Requires-Dist: litestar[standard]>=2.0.0
Requires-Dist: nats-py>=2.0.0
Requires-Dist: prometheus-client>=0.24.1
Requires-Dist: pyjwt>=2.8.0
Requires-Dist: python-json-logger>=4.0.0
Requires-Dist: redis>=5.0.0
Requires-Dist: sqlalchemy[asyncio]>=2.0.0
Requires-Dist: taskiq-nats>=0.4.0
Requires-Dist: taskiq>=0.11.0
Provides-Extra: tracing
Requires-Dist: opentelemetry-api>=1.40.0; extra == 'tracing'
Requires-Dist: opentelemetry-exporter-otlp>=1.40.0; extra == 'tracing'
Requires-Dist: opentelemetry-instrumentation-litestar>=0.1.0; extra == 'tracing'
Requires-Dist: opentelemetry-instrumentation-redis>=0.61b0; extra == 'tracing'
Requires-Dist: opentelemetry-instrumentation-sqlalchemy>=0.61b0; extra == 'tracing'
Requires-Dist: opentelemetry-sdk>=1.40.0; extra == 'tracing'
Description-Content-Type: text/markdown

# Framework M Standard

[![PyPI version](https://badge.fury.io/py/framework-m-standard.svg)](https://badge.fury.io/py/framework-m-standard)
[![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![GitLab Pipeline Status](https://gitlab.com/castlecraft/framework-m/badges/main/pipeline.svg)](https://gitlab.com/castlecraft/framework-m/-/pipelines)
[![Code style: ruff](https://img.shields.io/badge/code%20style-ruff-000000.svg)](https://github.com/astral-sh/ruff)

Default adapters and Desk UI serving for Framework M.

## Installation

```bash
pip install framework-m-standard
```

Or with `uv`:

```bash
uv add framework-m-standard
```

## What's Included

### Database Adapters

- **SQLAlchemy Repository** - Generic repository implementation with async support
- **Schema Mapper** - Automatic Pydantic → SQLAlchemy table generation
- **Migration System** - Alembic integration with auto-migration detection
- **Unit of Work** - Transaction management with optimistic concurrency control

### Web Framework

- **Litestar Integration** - REST API with automatic OpenAPI docs
- **Auth Guards** - JWT authentication and permission checking
- **Exception Handlers** - Consistent error responses
- **Desk UI Serving** - Bundled frontend assets served at `/desk/`

### Cache & Events

- **Redis Cache** - Distributed caching with TTL support
- **Redis Event Bus** - Pub/sub for domain events

### Background Jobs

- **Taskiq Integration** - Background job processing with NATS JetStream
- **Outbox Pattern** - Reliable event publishing

## Supported Databases

| Database   | Status          |
| ---------- | --------------- |
| PostgreSQL | ✅ Full support |
| SQLite     | ✅ For testing  |
| MySQL      | 🔜 Planned      |

## Usage

This package is typically used as a dependency of `framework-m`.
For most applications, install the full `framework-m` package instead.

```python
from framework_m_standard.adapters.db import GenericRepository
from framework_m_standard.adapters.cache import RedisCache
from framework_m_standard.adapters.web import create_litestar_app
```

## License

Apache 2.0 License - see [LICENSE](https://gitlab.com/castlecraft/framework-m/blob/main/LICENSE) for details.
