Skip to main content

Tiny module-service and dependency injection framework

Project description

Symbiont

Code style: black

Tiny module-service and dependency injection framework

Installation

pip install <>

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


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.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

symbiont-0.1.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file symbiont-0.1.0.tar.gz.

File metadata

  • Download URL: symbiont-0.1.0.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

Hashes for symbiont-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a873808be3e5f46f7063a2a07f5f624440908ce5ab7733879d57d362aff00a60
MD5 461d49700e1369e1ae42c2f8f33ff65b
BLAKE2b-256 5fabf325149fd8d4011340888ebabf935ec05c97a8fd3024f6d0283e8a3af90a

See more details on using hashes here.

File details

Details for the file symbiont-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: symbiont-0.1.0-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

Hashes for symbiont-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 270a68604e151724ab534e2cb8a341ab68612076a8516cee5bda81905499feca
MD5 2fc802e5c6a85f7229ebab40d1cc6156
BLAKE2b-256 e680e6cb2d1820eed97d9814a7faedfb9cc1693dd51378ee8f9f8cae5a910901

See more details on using hashes here.

Supported by

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