Dependency injection and context management helpers inspired by FastAPI and built on dependency-injector.
Project description
WePositive DI
WePositive DI is a small dependency injection layer on top of
dependency-injector 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 for a short working example, then use Providers for the full provider matrix and API Reference for exact signatures.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wepositive_di-0.1.5.tar.gz.
File metadata
- Download URL: wepositive_di-0.1.5.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f6f35cfe5acb40d3091a83b6cb36b238fb841f7a7d27913dfaa2c91f2dfb767
|
|
| MD5 |
86cd4c51a9cc09180e0e981b9e0f7cc7
|
|
| BLAKE2b-256 |
b3ebd973193547078662525f59852fb8d1f31c60d30d77e6198faff7f8bf39ac
|
File details
Details for the file wepositive_di-0.1.5-py3-none-any.whl.
File metadata
- Download URL: wepositive_di-0.1.5-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
376e4b82c37bb0d58eb57d9b2cec48d85c634248c50ab93540f2b5387bfd5650
|
|
| MD5 |
bb1a5716468e1903c123937e10f82c38
|
|
| BLAKE2b-256 |
f43cd33f8be0adc025539ec34c00d65ade10b394ff32826c684807493382f662
|