Metadata-Version: 2.4
Name: codex-core
Version: 0.2.0
Summary: Core utilities, schemas and settings for Codex WaaS toolkit
Project-URL: Homepage, https://github.com/codexdlc/codex-core
Project-URL: Documentation, https://codexdlc.github.io/codex-core/
Project-URL: Repository, https://github.com/codexdlc/codex-core
Project-URL: Changelog, https://github.com/codexdlc/codex-core/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/codexdlc/codex-core/issues
Author: CodexDLC
License: Apache-2.0
Keywords: core,pydantic,toolkit,waas
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Requires-Python: >=3.10
Requires-Dist: pydantic-settings>=2.0
Requires-Dist: pydantic<3.0,>=2.0
Provides-Extra: dev
Requires-Dist: bandit>=1.7; extra == 'dev'
Requires-Dist: detect-secrets>=1.5; extra == 'dev'
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pip-audit>=2.7; extra == 'dev'
Requires-Dist: pre-commit>=3.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mike>=2.0; extra == 'docs'
Requires-Dist: mkdocs-include-markdown-plugin; extra == 'docs'
Requires-Dist: mkdocs-material>=9.0; extra == 'docs'
Requires-Dist: mkdocs>=1.5; extra == 'docs'
Requires-Dist: mkdocstrings[python]>=0.24; extra == 'docs'
Provides-Extra: loguru
Requires-Dist: loguru>=0.7.0; extra == 'loguru'
Description-Content-Type: text/markdown

<!-- Type: LANDING -->
# codex-core

[![PyPI](https://img.shields.io/pypi/v/codex-core)](https://pypi.org/project/codex-core/)
[![Python](https://img.shields.io/pypi/pyversions/codex-core)](https://pypi.org/project/codex-core/)
[![License](https://img.shields.io/badge/license-Apache--2.0-green)](https://github.com/codexdlc/codex-core/blob/main/LICENSE)
[![Documentation](https://img.shields.io/badge/docs-codexdlc.github.io-blue)](https://codexdlc.github.io/codex-core/)

Core utilities, immutable DTOs, and environment-driven settings for the Codex WaaS toolkit.
Provides the foundational building blocks and PII masking used by all other Codex components.

---

## Install

```bash
# Core only
pip install codex-core

# With Loguru support for advanced structured logging
pip install "codex-core[loguru]"
```

## Quick Start

```python
from codex_core.core.base_dto import BaseDTO

# 1. Define an immutable, PII-aware data transfer object
class UserDTO(BaseDTO):
    id: int
    email: str         # Automatically masked in logs
    phone_number: str  # Automatically masked in logs

user = UserDTO(id=42, email="user@example.com", phone_number="+491511234567")

# 2. Safely log the DTO without leaking personal data
print(user)
# Output: UserDTO(id=42, email='***', phone_number='***')
```

## Modules

| Module | Extra | Description |
| :--- | :--- | :--- |
| `codex_core.core` | - | Immutable `BaseDTO` and automated `PIIRegistry` for GDPR-safe logging. |
| `codex_core.common` | `[loguru]` | Phone/name normalization and structured logging adapters (`TaskLogContext`). |
| `codex_core.settings` | - | Environment-driven configuration via `BaseCommonSettings` (Pydantic Settings). |
| `codex_core.dev` | `[dev]` | Internal developer tools (`BaseCheckRunner`, `StaticCompiler`, `ProjectTreeGenerator`). |

## Documentation

Full docs with architecture, API reference, and data flow diagrams:

**[https://codexdlc.github.io/codex-core/](https://codexdlc.github.io/codex-core/)**

## Part of the Codex ecosystem

- **[codex-core](https://github.com/codexdlc/codex-core)**: Foundational utilities and DTOs.
- **[codex-platform](https://github.com/codexdlc/codex-platform)**: Core platform components and HTTP APIs.
- **[codex-bot](https://github.com/codexdlc/codex-bot)**: Telegram AI-agent infrastructure.
- **[codex-services](https://github.com/codexdlc/codex-services)**: Business logic engines (Booking, CRM).
- **[codex-ai](https://github.com/codexdlc/codex-ai)**: LLM abstraction layer.
