Skip to main content
# dependency injection

A dependency injection framework for python.

Just like `Microsoft.Extensions.DependencyInjection`.

## Usage

``` py
class A:
pass

class B:
def __init__(self, a: A):
assert isinstance(a, A)

import dependencyinjection as di

service = di.Services()
service.scoped(A)
service.singleton(B)
provider = service.build()
assert isinstance(provider.get(A), A)
assert isinstance(provider.get(B), B)

with provider.scope() as scoped_provider:
assert provider.get(A) is provider.get(A)
assert scoped_provider.get(B) is scoped_provider.get(B)
assert provider.get(B) is scoped_provider.get(B)
assert not (provider.get(A) is scoped_provider.get(A))
```

Metadata

Release files for dependencyinjection 0.1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dependencyinjection 0.1.3.0
File Size Uploaded Provenance
dependencyinjection-0.1.3.0.tar.gz 6.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for dependencyinjection 0.1.3.0
File Interpreter ABI Platform
dependencyinjection-0.1.3.0-py3.6.egg Legacy Egg format - - Details

Total release size: 35.8 kB

Release files / dependencyinjection-0.1.3.0.tar.gz

Download URL dependencyinjection-0.1.3.0.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b0946f8e2e90de71538ec87913a3c1894df739d2cba701a2a488cd1135ebe901
BLAKE2b-256 checksum
How to use checksums
45e32590f64a2d652428312bdf082170b7de80b2b39e610f5ea1f73e66d067d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / dependencyinjection-0.1.3.0-py3.6.egg

Download URL dependencyinjection-0.1.3.0-py3.6.egg
Size 29.5 kB
Tags Egg
SHA-256 checksum
How to use checksums
320d892179afa7cd7f2d8df4aac2320a10d83f3c102b35370a9a78566335de65
BLAKE2b-256 checksum
How to use checksums
da5719ed53f3c2fa1ea7e5174fe45faa083c768b212218b92f46269387f93886
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for dependencyinjection 0.1.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page