Gimme That
A lightweight, simple but extensible dependency injection framework. Read the full documentation here
Getting started
Install from PyPI
pip install gimme-that
Basic usage
import gimme
class MyService:
pass
class ServiceConsumer:
def __init__(self, service: MyService):
self.service = service
# gimme.that automatically detects and resolves dependencies based on type annotations
consumer = gimme.that(ServiceConsumer)
isinstance(consumer.service, MyService) # True
Features
Automatically detects dependencies based on type annotations
Works with dataclass classes and attr.s
Class repository that stores created objects for re-use
Register classes to provide additional configuration on how gimme.that should instantiate classes
Custom factory functions
Store or do not store created objects
Provide additional keyword arguments to the initializer
Scoped repositories to manage the lifetime of created objects (useful for testing)
Does not require any decorators or other additions to your classes (most of the time). They remain your classes
Detects circular dependencies, and provides the means to resolve them
Extensibility using plugins: create your own logic for resolving dependencies and instantiating classes
Development
pip install -e .[dev]
Metadata
Release files for gimme-that 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gimme-that-0.3.1.tar.gz | 11.7 kB | Without provenance | Details for gimme-that-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gimme_that-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for gimme_that-0.3.1-py3-none-any.whl |
Total release size: 23.7 kB
Release files / gimme-that-0.3.1.tar.gz
| Download URL | gimme-that-0.3.1.tar.gz |
|---|---|
| Size | 11.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
143d4551c65f625abbb9c55995a521fec68d6a34b561516919e293c8c40d72f1
|
|
BLAKE2b-256 checksum How to use checksums |
27c273fdf90901ba4fb5f042a200e730ae094f48ca982240149b0fc8559afe45
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.1
|
Release files / gimme_that-0.3.1-py3-none-any.whl
| Download URL | gimme_that-0.3.1-py3-none-any.whl |
|---|---|
| Size | 12.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3abf4ac9cf145714b25363aa3b387af696f771951cdbefd4f86953a4c5d38ff4
|
|
BLAKE2b-256 checksum How to use checksums |
b9648430fc6d24fde977268fa63f5cad139a0facbb435d75fba961470fd3d6f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.1
|
Security for gimme-that 0.3.1
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.