Metadata-Version: 2.4
Name: bear-dereth
Version: 0.3.7
Summary: A set of common tools for various bear projects.
Author-email: chaz <bright.lid5647@fastmail.com>
Requires-Python: >=3.12
Requires-Dist: bear-epoch-time>=1.2.2
Requires-Dist: distro>=1.9.0
Requires-Dist: pydantic>=2.11.5
Requires-Dist: pyyaml>=6.0.3
Requires-Dist: rich>=14.1.0
Requires-Dist: singleton-base>=1.2.3
Requires-Dist: tomlkit>=0.13.3
Description-Content-Type: text/markdown


# Bear Dereth

[![pypi version](https://img.shields.io/pypi/v/bear-dereth.svg)](https://pypi.org/project/bear-dereth/)

A set of common tools for various bear projects.

## Installation

```bash
uv pip install bear-dereth
```

## Dependency Injection

The project ships with a lightweight dependency injection container.  Services
can register cleanup callbacks that run when the container shuts down:

```python
from bear_dereth.di import DeclarativeContainer

class AppContainer(DeclarativeContainer):
    db: Database

db = Database()
AppContainer.register("db", db)
AppContainer.register_teardown(lambda: db.close())
AppContainer.shutdown()
```

Callbacks registered with :func:`register_teardown` run after any service
``shutdown()`` method has been invoked.
