symbiont


Namesymbiont JSON
Version 0.1.1 PyPI version JSON
download
home_page
SummaryTiny module-service and dependency injection framework
upload_time2023-09-19 14:38:22
maintainer
docs_urlNone
authorIvan Borisenko
requires_python>=3.8,<4.0
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Symbiont

[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

Tiny module-service and dependency injection framework

## Installation

```bash
pip install symbiont
```

## Usage

```python
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):
    ...

```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "symbiont",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Ivan Borisenko",
    "author_email": "contact@13g10n.com",
    "download_url": "https://files.pythonhosted.org/packages/aa/ee/8a679beb598b6e10f48009ff0979fb2f20151c7f75026057b5f842d94764/symbiont-0.1.1.tar.gz",
    "platform": null,
    "description": "# Symbiont\n\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\nTiny module-service and dependency injection framework\n\n## Installation\n\n```bash\npip install symbiont\n```\n\n## Usage\n\n```python\nfrom symbiont import Module, Injectable, DependencyInjector\n\n\nclass BarService(Injectable):\n    x: int = 42\n\n\nclass FooService(Injectable):\n    bar: BarService\n\n\nclass ExampleModule(\n    Module,\n    providers=[BarService, FooService]\n):\n    foo: FooService\n\n\nclass RootModule(\n    Module,\n    imports=[ExampleModule]\n):\n    foo: FooService\n\n\ninjector = DependencyInjector()\nroot = injector.initialize(RootModule)\n\n\n@injector.inject\ndef example_method(a, foo: FooService):\n    ...\n\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Tiny module-service and dependency injection framework",
    "version": "0.1.1",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0ac435e3a76e239c5c901e0f584caaf85b89da8438af99ea3fdf854ab984e51f",
                "md5": "726c45a59fc4e82cf456b96b3ce7d8bb",
                "sha256": "0b79de09f8e69b61d50516067bc7a4c9b1a04dca5f178bc4a3c7f638861c85f0"
            },
            "downloads": -1,
            "filename": "symbiont-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "726c45a59fc4e82cf456b96b3ce7d8bb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 3672,
            "upload_time": "2023-09-19T14:38:21",
            "upload_time_iso_8601": "2023-09-19T14:38:21.360958Z",
            "url": "https://files.pythonhosted.org/packages/0a/c4/35e3a76e239c5c901e0f584caaf85b89da8438af99ea3fdf854ab984e51f/symbiont-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aaee8a679beb598b6e10f48009ff0979fb2f20151c7f75026057b5f842d94764",
                "md5": "aa5d14b3489608a85a7355b9f2040281",
                "sha256": "cadad063d0b9b71e2b06058168ba138e55e215b588e2a6c9c3fad35be0c065a0"
            },
            "downloads": -1,
            "filename": "symbiont-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "aa5d14b3489608a85a7355b9f2040281",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 2886,
            "upload_time": "2023-09-19T14:38:22",
            "upload_time_iso_8601": "2023-09-19T14:38:22.648073Z",
            "url": "https://files.pythonhosted.org/packages/aa/ee/8a679beb598b6e10f48009ff0979fb2f20151c7f75026057b5f842d94764/symbiont-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-19 14:38:22",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "symbiont"
}
        
Elapsed time: 0.27138s