Pre-release
This release is a pre-release and may not be stable for production use.
pypotage
A simple Python package that provides an easy way to use Dependency Injection in your projects.
Key Features
- Easy to use
- Supports both function and class-based dependency injection
- Allows customizing the way dependencies are resolved
- Allows for the use of custom containers
Installing
To install the latest pypotage version, run the following command:
python -m pip install -U pypotage
Development
To install the development version:
git clone https://github.com/pavalso/potage.git
cd potage
python -m pip install -U .
Quick Examples
Basic usage
import pypotage
import logging
@pypotage.prepare
def logger():
logging.basicConfig(level=logging.DEBUG)
return logging.getLogger(__name__)
pypotage.cook(logging.Logger).take_out().info("Hello World!")
Using classes
import pypotage
class A:
def __init__(self):
...
@pypotage.prepare
class B(A):
def __init__(self):
...
pypotage.cook(A).take_out() # returns an instance of B
Metadata
Release files for pypotage 2.0.0.1a0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pypotage-2.0.0.1a0.tar.gz | 16.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pypotage-2.0.0.1a0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 38.5 kB
Release files / pypotage-2.0.0.1a0.tar.gz
| Download URL | pypotage-2.0.0.1a0.tar.gz |
|---|---|
| Size | 16.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
213b6be8b953fa82ceacc507031bcd524e7de420175b6e6e17b09ec4f8c82c1d
|
|
BLAKE2b-256 checksum How to use checksums |
670fd7cfe7524a15c6e6ddf47f8d49f1651828bf872b0b66c4a09619516c39be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Release files / pypotage-2.0.0.1a0-py3-none-any.whl
| Download URL | pypotage-2.0.0.1a0-py3-none-any.whl |
|---|---|
| Size | 21.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
96baff43b0de78926fc0eeabc1c8df951cf641beff92a6a848cdd29c8b2d9524
|
|
BLAKE2b-256 checksum How to use checksums |
c1a045e4771b196271494842ccbf2d2e03087c3d78a218d46a95c3d3e9edcd5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|