{ "info": { "author": "Kamil Maciejko", "author_email": "maciejkokamil@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# Gluer\n\n*Dependency Injection for Python*\n\n### Installation\n\nGluer uses [type annotations](https://www.python.org/dev/peps/pep-0484/), so python 3.6+ is required\n\n\tpython3 -m pip install --user gluer\n\n\n### Usage\n\n\nLet's follow a [wonderful explanation](https://stackoverflow.com/a/1638961/4339338) of DI:\n\n\n```python\nfrom abc import ABC, abstractmethod\nfrom gluer import Gluer\n\nclass Drink(ABC): # this doesn't *have* to be abstract\n\t@abstractmethod\n\tdef sip(self):\n\t\tpass\n\n\nclass Child:\n\tdef __init__(self, drink: Drink):\n\t\tself.drink = drink\n\n\tdef take_a_sip(self):\n\t\tself.drink.sip()\n\t\tprint(\"ahhh\")\n\n\nclass Juice(Drink):\n\tdef sip(self):\n\t\tprint(\"*gulp*\")\n\n\nclass Coke(Drink):\n\tdef sip(self):\n\t\tprint(\"*fizzle*\")\n\n\n\nif __name__ == \"__main__\":\n\tgluer = Gluer()\n\tmom_watches = True\n\n\tgluer.register(Child)\n\tgluer.register(Juice if mom_watches else Coke).As(Drink)\n\n\tcontainer = gluer.build()\n\n\tkid = container.resolve(Child)\n\tkid.take_a_sip() # *gulp* ahhh\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "gluer", "package_url": "https://pypi.org/project/gluer/", "platform": "", "project_url": "https://pypi.org/project/gluer/", "project_urls": null, "release_url": "https://pypi.org/project/gluer/0.2.0/", "requires_dist": null, "requires_python": ">=3.6.0", "summary": "Dependency injection for python", "version": "0.2.0" }, "last_serial": 4340159, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "96e6d4d7dd95c4d6106c5ccbfa830287", "sha256": "632f6e827c6613b89d74cde4843d938a0dd50b6a9e34ab31e6691f1ae990caa8" }, "downloads": -1, "filename": "gluer-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "96e6d4d7dd95c4d6106c5ccbfa830287", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6.0", "size": 4431, "upload_time": "2018-09-05T15:40:01", "url": "https://files.pythonhosted.org/packages/3f/e5/50a1577587a58f7bc964f98d678021c7b2018a23368c72783af687a3ba5d/gluer-0.0.1-py3-none-any.whl" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "416ce12220b085ed6ebb9e05e90e6be0", "sha256": "6492e1bd54befac2d7f8dd453e83b314ade314b139aad30f3fb642979813d25d" }, "downloads": -1, "filename": "gluer-0.2.0.tar.gz", "has_sig": false, "md5_digest": "416ce12220b085ed6ebb9e05e90e6be0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 3566, "upload_time": "2018-10-04T12:45:00", "url": "https://files.pythonhosted.org/packages/a8/94/53db582549eac9d3b547c2da5024b664f5f8c825e4da0141c33ad0ee8e61/gluer-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "416ce12220b085ed6ebb9e05e90e6be0", "sha256": "6492e1bd54befac2d7f8dd453e83b314ade314b139aad30f3fb642979813d25d" }, "downloads": -1, "filename": "gluer-0.2.0.tar.gz", "has_sig": false, "md5_digest": "416ce12220b085ed6ebb9e05e90e6be0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 3566, "upload_time": "2018-10-04T12:45:00", "url": "https://files.pythonhosted.org/packages/a8/94/53db582549eac9d3b547c2da5024b664f5f8c825e4da0141c33ad0ee8e61/gluer-0.2.0.tar.gz" } ] }