Metadata-Version: 2.4
Name: dtpyfw
Version: 0.5.13
Summary: DealerTower Python Framework: reusable building‑blocks for DealerTower services
License: DealerTower Proprietary License
License-File: LICENSE
Keywords: framework,microservices,fastapi,sqlalchemy,celery
Author: Reza Shirazi
Author-email: reza@dealertower.com
Requires-Python: >=3.11,<4.0
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: Other/Proprietary 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: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Provides-Extra: all
Provides-Extra: api
Provides-Extra: bucket
Provides-Extra: db
Provides-Extra: db-mysql
Provides-Extra: encrypt
Provides-Extra: ftp
Provides-Extra: kafka
Provides-Extra: normal
Provides-Extra: redis
Provides-Extra: slim-api
Provides-Extra: slim-task
Provides-Extra: worker
Requires-Dist: PyMySQL (>=1.1.2,<1.2.0) ; extra == "db-mysql"
Requires-Dist: SQLAlchemy (>=2.0.42,<2.1.0) ; extra == "all" or extra == "normal" or extra == "slim-api" or extra == "slim-task" or extra == "db" or extra == "db-mysql"
Requires-Dist: aiomysql (>=0.2.0,<0.3.0) ; extra == "db-mysql"
Requires-Dist: asyncpg (>=0.30.0,<0.31.0) ; extra == "all" or extra == "normal" or extra == "slim-api" or extra == "slim-task" or extra == "db"
Requires-Dist: bcrypt (>=4.3.0,<4.4.0) ; extra == "all" or extra == "encrypt"
Requires-Dist: boto3 (>=1.40.4,<1.41.0) ; extra == "all" or extra == "bucket"
Requires-Dist: celery (>=5.5.3,<5.6.0) ; extra == "all" or extra == "normal" or extra == "slim-task" or extra == "worker"
Requires-Dist: celery-redbeat (>=2.3.3,<2.4.0) ; extra == "all" or extra == "normal" or extra == "slim-task" or extra == "worker"
Requires-Dist: celery_once (>=3.0.1,<3.1.0) ; extra == "all" or extra == "normal" or extra == "slim-task" or extra == "worker"
Requires-Dist: fastapi (>=0.116.1,<0.117.0) ; extra == "all" or extra == "normal" or extra == "slim-api" or extra == "api"
Requires-Dist: gunicorn (>=23.0.0,<23.1.0) ; extra == "all" or extra == "normal" or extra == "slim-api" or extra == "api"
Requires-Dist: kafka-python (>=2.2.15,<2.3.0) ; extra == "all" or extra == "kafka"
Requires-Dist: paramiko (>=4.0.0,<4.1.0) ; extra == "all" or extra == "ftp"
Requires-Dist: passlib[argon2,bcrypt] (>=1.7.4,<1.8.0) ; extra == "all" or extra == "encrypt"
Requires-Dist: psycopg2 (>=2.9.10,<2.10.0) ; extra == "all" or extra == "normal" or extra == "slim-api" or extra == "slim-task" or extra == "db"
Requires-Dist: pydantic (>=2.11.8,<2.12.0)
Requires-Dist: python-dateutil (>=2.9.0,<2.10.0) ; extra == "all" or extra == "ftp"
Requires-Dist: python-jose (>=3.5.0,<3.6.0) ; extra == "all" or extra == "encrypt"
Requires-Dist: python-multipart (>=0.0.20,<0.1.0) ; extra == "all" or extra == "normal" or extra == "slim-api" or extra == "api"
Requires-Dist: redis (>=6.4.0,<6.5.0) ; extra == "all" or extra == "normal" or extra == "slim-task" or extra == "redis" or extra == "worker"
Requires-Dist: requests (>=2.32.3,<2.33.0)
Requires-Dist: uvicorn (>=0.35.0,<0.36.0) ; extra == "all" or extra == "normal" or extra == "slim-api" or extra == "api"
Project-URL: Homepage, https://github.com/datgate/dtpyfw
Project-URL: Repository, https://github.com/datgate/dtpyfw
Description-Content-Type: text/markdown

# DealerTower Python Framework (dtpyfw)

[![Python Version](https://img.shields.io/badge/python-3.11%2B-blue.svg)](https://www.python.org/downloads/)
[![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Type Checked](https://img.shields.io/badge/type%20checked-mypy-blue.svg)](http://mypy-lang.org/)
[![License](https://img.shields.io/badge/license-Proprietary-red.svg)](LICENSE)

**DealerTower Framework** provides reusable building blocks for microservices. It is organized into modular sub-packages focused on different domains: Core, API, Database, Bucket, FTP, Redis, Kafka, Worker, Log, and Encryption.

This library follows Python packaging standards including PEP 561 for type checking support.

---

## 🚀 Installation

Requires **Python 3.11** or newer (supports Python 3.11 and 3.12).

### Base package & Core

```bash
pip install dtpyfw
```

Using Poetry (development):

```bash
poetry install -E all
```

### Package Metadata

Query the installed version programmatically:

```python
import dtpyfw
print(dtpyfw.__version__)
```

### Optional Extras

Install just the features you need; extras can be combined, for example `pip install dtpyfw[api,db]`.

| Sub-Package | Description | Install Command | Docs |
| ----------- | ----------- | --------------- | ---- |
| **core**    | Env, errors, async bridge, utils | included in base | [Core Docs](docs/core.md) |
| **api**     | FastAPI middleware & routing helpers | `pip install dtpyfw[api]` | [API Docs](docs/api.md) |
| **db**      | SQLAlchemy sync/async & search tools | `pip install dtpyfw[db]` | [DB Docs](docs/db.md) |
| **bucket**  | S3-compatible file management | `pip install dtpyfw[bucket]` | [Bucket Docs](docs/bucket.md) |
| **ftp**     | FTP and SFTP convenience wrappers | `pip install dtpyfw[ftp]` | [FTP Docs](docs/ftp.md) |
| **redis**   | Redis clients & Streams consumer | `pip install dtpyfw[redis]` | [Redis Docs](docs/redis.md) |
| **kafka**   | Kafka messaging utilities | `pip install dtpyfw[kafka]` | [Kafka Docs](docs/kafka.md) |
| **worker**  | Celery task & scheduler setup | `pip install dtpyfw[worker]` | [Worker Docs](docs/worker.md) |
| **log**     | Structured logging helpers | included in base | [Log Docs](docs/log.md) |
| **encrypt** | Password hashing & JWT utilities | `pip install dtpyfw[encrypt]` | [Encryption Docs](docs/encrypt.md) |
| **slim-task** | DB, Redis, Worker | `pip install dtpyfw[slim-task]` | — |
| **slim-api**  | API, DB | `pip install dtpyfw[slim-api]` | — |
| **normal**    | API, DB, Redis, Worker | `pip install dtpyfw[normal]` | — |
| **all**       | Everything above | `pip install dtpyfw[all]` | — |

---

## 📦 Sub-Package Summaries

### Core

Essential utilities for environment management, error handling, async bridging and general helpers. [Core Docs](docs/core.md)

### API

FastAPI application factory, middleware and routing helpers. [API Docs](docs/api.md)

### Database

Sync and async SQLAlchemy orchestration with search helpers. [DB Docs](docs/db.md)

### Bucket

S3-compatible storage convenience functions. [Bucket Docs](docs/bucket.md)

### FTP/SFTP

Unified clients for FTP and SFTP operations. [FTP Docs](docs/ftp.md)

### Redis & Streams

Redis caching utilities and Streams consumers/senders. [Redis Docs](docs/redis.md)

### Kafka

Producer and consumer wrappers for Kafka messaging. [Kafka Docs](docs/kafka.md)

### Worker

Helpers for configuring Celery workers and schedules. [Worker Docs](docs/worker.md)

### Log

Structured logging configuration and helpers. [Log Docs](docs/log.md)

### Encryption

Password hashing and JWT helpers. [Encryption Docs](docs/encrypt.md)

---

## 🤝 Contributing

We welcome contributions from authorized DealerTower employees and contractors! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on:

- Development setup
- Coding standards and style guide
- Testing requirements
- Pull request process
- Type annotations and docstring conventions

---

## 📝 Changelog

See [CHANGELOG.md](CHANGELOG.md) for a list of changes in each release.

---

## 📄 License

DealerTower Python Framework is proprietary. See [LICENSE](LICENSE) for terms.

## Development

- Install dependencies: `poetry install -E all`
- Run tests: `pytest` (from repo root)
- Format and lint: `autoflake -r --remove-all-unused-imports --ignore-init-module-imports . && isort . && black . && ruff check . --fix && docformatter -r -i .`
- Type-check: `mypy dtpyfw`

