Skip to main content

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

wepositive_di-0.1.4.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wepositive_di-0.1.4-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file wepositive_di-0.1.4.tar.gz.

File metadata

  • Download URL: wepositive_di-0.1.4.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

Hashes for wepositive_di-0.1.4.tar.gz
Algorithm Hash digest
SHA256 7d33b3e7e55c676ff29bfa742132a74b71d3bef9dc00137839660096c736dd41
MD5 f8f7f08965b27d39d12641d879568cdc
BLAKE2b-256 7aa7f95f84c11b405dd8c6c1ec87d25fe4eb9b5faf3098cff65446452be5664a

See more details on using hashes here.

File details

Details for the file wepositive_di-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: wepositive_di-0.1.4-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

Hashes for wepositive_di-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1f39d0d424a6f1e6e5b7cc3f7eca442e4c28f9b717b3cc890aa8a0ff0751a6df
MD5 2588ecfdc76ef402fd5f4c8e36c67c94
BLAKE2b-256 57b1c80d99188ddf94919a8708a2b1de074b85b0360915092565ed880c7359f0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page