Tiny module-service and dependency injection framework
Project description
Symbiont
Tiny module-service and dependency injection framework
Installation
pip install symbiont
Usage
from symbiont import Module, Injectable, DependencyInjector
class BarService(Injectable):
x: int = 42
class FooService(Injectable):
bar: BarService
class ExampleModule(
Module,
providers=[BarService, FooService]
):
foo: FooService
class RootModule(
Module,
imports=[ExampleModule]
):
foo: FooService
injector = DependencyInjector()
root = injector.initialize(RootModule)
@injector.inject
def example_method(a, foo: FooService):
...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
symbiont-0.1.1.tar.gz
(2.9 kB
view details)
Built Distribution
File details
Details for the file symbiont-0.1.1.tar.gz
.
File metadata
- Download URL: symbiont-0.1.1.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.1 CPython/3.10.4 Darwin/22.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cadad063d0b9b71e2b06058168ba138e55e215b588e2a6c9c3fad35be0c065a0 |
|
MD5 | aa5d14b3489608a85a7355b9f2040281 |
|
BLAKE2b-256 | aaee8a679beb598b6e10f48009ff0979fb2f20151c7f75026057b5f842d94764 |
File details
Details for the file symbiont-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: symbiont-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.1 CPython/3.10.4 Darwin/22.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b79de09f8e69b61d50516067bc7a4c9b1a04dca5f178bc4a3c7f638861c85f0 |
|
MD5 | 726c45a59fc4e82cf456b96b3ce7d8bb |
|
BLAKE2b-256 | 0ac435e3a76e239c5c901e0f584caaf85b89da8438af99ea3fdf854ab984e51f |