Metadata-Version: 2.4
Name: wepositive-di
Version: 0.1.1
Summary: Dependency injection and context management helpers inspired by FastAPI and built on dependency-injector.
License-Expression: Apache-2.0
Keywords: dependency-injection,context-management,dependency-injector,fastapi,wepositive
Author: Dolf Andringa
Author-email: dolf@wepositive.energy
Maintainer: WePositive
Maintainer-email: info@wepositive.energy
Requires-Python: >=3.12
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Typing :: Typed
Requires-Dist: aiologic (>=0.16.0,<0.17.0)
Requires-Dist: dependency-injector (>=4.49.0,<5.0.0)
Requires-Dist: pydantic (>=2.13.4,<3.0.0)
Requires-Dist: pydantic-settings (>=2.14.1,<3.0.0)
Project-URL: Company, https://wepositive.energy
Project-URL: Documentation, https://wepositive-energy.github.io/wepositive-di/
Project-URL: Homepage, https://wepositive.energy
Project-URL: Issues, https://github.com/WePositive-energy/wepositive-di/issues
Project-URL: Repository, https://github.com/WePositive-energy/wepositive-di
Description-Content-Type: text/markdown

# WePositive DI

WePositive DI is a small dependency injection layer on top of
[`dependency-injector`](https://python-dependency-injector.ets-labs.org/) with
FastAPI-style dependency declarations that can be used in any Python
application.

It has two parts:

| Part | Purpose |
| --- | --- |
| Dependency injection | Register sync, async, factory, singleton, and context manager providers, then inject them with `Depends[...]`. |
| Context management | Store typed Pydantic context objects in an async-safe storage backend and expose the storage through DI. |

## Why use it?

- Use the same dependency patterns in scripts, workers, web apps, and tests.
- Keep dependencies explicit without passing every object through every call.
- Manage resources with context manager providers that clean up after each call.
- Swap implementations with provider overrides for tests or deployment-specific storage.

## Start here

Read [Getting Started](getting-started.md) for a short working example, then use
[Providers](providers.md) for the full provider matrix and [API Reference](api/di.md)
for exact signatures.

