Metadata-Version: 2.4
Name: cmdop-utils
Version: 0.2.1
Summary: Framework-neutral structured logging and Telegram utilities for CMDOP services.
Project-URL: Homepage, https://cmdop.com
Project-URL: Documentation, https://docs.cmdop.com
Project-URL: Repository, https://github.com/commandoperator/cmdop-utils
Project-URL: Bug Tracker, https://github.com/commandoperator/cmdop-utils/issues
License-Expression: Apache-2.0
Keywords: cmdop,logging,structlog,telegram
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.12
Requires-Dist: pydantic-settings>=2.0
Requires-Dist: pydantic>=2.8
Requires-Dist: pytelegrambotapi>=4.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: rich>=13
Requires-Dist: structlog>=25.5
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: twine>=5.0; extra == 'dev'
Description-Content-Type: text/markdown

# cmdop-utils

Small framework-neutral utilities shared by CMDOP services.

```bash
pip install cmdop-utils
```

As of `0.2.0`, the former umbrella package has been split:

- LLM transport and the current agent harness: `pip install cmdop-llm`
  (`import cmdop_llm`)
- Client generation: `pip install cmdop-codegen`
  (`import cmdop_codegen`)
- The obsolete `cmdop_utils.agent` implementation was removed; use the harness
  shipped in `cmdop_llm.agent`.

`cmdop-utils` now contains only focused logging and Telegram helpers.

## Structured logging

```python
from cmdop_utils.logging import configure_logging, get_logger

configure_logging(service="billing", environment="production")
logger = get_logger(__name__)
logger.info("invoice_created", invoice_id="inv_123", amount="19.00")
```

The logger uses `structlog`, async-safe queue-backed sinks, compact machine
output, context scoping, redaction, rate limiting, and a Rich console renderer.

## Telegram

```python
from cmdop_utils.telegram import DjangoTelegram

telegram = DjangoTelegram(
    bot_token="your-token",
    chat_id="your-chat-id",
)
telegram.send_message("Deployment completed", fail_silently=True)
```

`DjangoTelegram` keeps its historical name but does not depend on Django.
Credentials can be passed explicitly or supplied through the env-backed
`cmdop_utils._compat` configuration seam.

## Development and release

```bash
python -m pip install -e ".[dev]"
pytest
python ../publishing/publish.py cmdop-utils --build-only
```
