{ "info": { "author": "Micha\u0142 Podeszwa", "author_email": "michal.podeszwa@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3 :: Only", "Topic :: Utilities" ], "description": "# pySyringe\n\n[![Build Status](https://travis-ci.org/MichalPodeszwa/pySyringe.svg)](https://travis-ci.org/MichalPodeszwa/pySyringe)\n[![Coverage Status](https://coveralls.io/repos/MichalPodeszwa/pySyringe/badge.svg?branch=master&service=github)](https://coveralls.io/github/MichalPodeszwa/pySyringe?branch=master)\n\nThis is `pySyringe`. Inversion of Control container, which helps you get proper [`Dependency Injection`](https://en.wikipedia.org/wiki/Dependency_injection), while still being Pythonic.\n\nCurrently `pySyringe` works only on Python 3.3+. Maybe later, support for older versions will be added.\n\n## Installation\n\n pip install pysyringe\n\n## Usage\n\n```python\n>>> import pysyringe\n>>>\n>>> class Foo:\n...\n... def __init__(self):\n... self.bar = 42\n...\n>>> @pysyringe.inject(foo=Foo)\n... def important_function(foo):\n... return foo.bar\n...\n>>> important_function()\n42\n\n>>> class Mock:\n... def __init__(self):\n... self.bar = 1\n...\n>>> important_function(Mock())\n>>>\n>>> @pysyringe.inject_value(foo=42)\n... def important_function2(foo):\n... return foo\n>>> important_function2()\n42\n\n```\n\nAs you can see testing is **a lot** simpler now. You don't need as much _(hopefully none)_ mocking as you used to.\n\nIf `pySyringe` injects the same class twice, it doesn't create instances twice, it simply returns previous one.\n\n## Testing\n\n1. Clone this repository\n2. Run `python setup.py develop`\n3. Install `pytest` from `pip`\n4. Run `py.test`\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/michalpodeszwa/pySyringe", "keywords": "di ioc container dependency injection", "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "pySyringe", "package_url": "https://pypi.org/project/pySyringe/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pySyringe/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/michalpodeszwa/pySyringe" }, "release_url": "https://pypi.org/project/pySyringe/1.2.0/", "requires_dist": null, "requires_python": null, "summary": "Pythonic dependency injection container", "version": "1.2.0" }, "last_serial": 1865427, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "c62c227c124be85a42a4ba251024ab71", "sha256": "add43aa45af386391a58568a067271123ce3415ff15eb69ff502a9a8ee3f53a7" }, "downloads": -1, "filename": "pySyringe-1.0.tar.gz", "has_sig": false, "md5_digest": "c62c227c124be85a42a4ba251024ab71", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1975, "upload_time": "2015-11-18T06:25:22", "url": "https://files.pythonhosted.org/packages/a7/0f/1b0b93be33d94ad5a2cb10c7b962d847dc1dcda74948ff4b94a74049a4df/pySyringe-1.0.tar.gz" } ], "1.0.1": [], "1.0.2": [ { "comment_text": "", "digests": { "md5": "97031b25c5272d47927fd59457581bd9", "sha256": "58509e474f02f376553730eee7f96ba6f19445c9855eb351f7a62e509ba5212d" }, "downloads": -1, "filename": "pySyringe-1.0.2.tar.gz", "has_sig": false, "md5_digest": "97031b25c5272d47927fd59457581bd9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2117, "upload_time": "2015-12-01T20:41:54", "url": "https://files.pythonhosted.org/packages/22/8e/2c15629e5271d2cc40d62b48216a94f5537cb531f3d2f16f4565c23e9cb4/pySyringe-1.0.2.tar.gz" } ], "1.1.0": [], "1.1.1": [ { "comment_text": "", "digests": { "md5": "1ca365e9d724fe3661f02840b2b74a4c", "sha256": "e722e53c12a1c6d6623763a82f7b1d4aface2732d88be9ddccd7493afc1f8f81" }, "downloads": -1, "filename": "pySyringe-1.1.1.tar.gz", "has_sig": false, "md5_digest": "1ca365e9d724fe3661f02840b2b74a4c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2060, "upload_time": "2015-12-16T17:49:46", "url": "https://files.pythonhosted.org/packages/92/68/e697957e541ca64b8082342c67868aaa382b3ef99907d7c9060a948de53c/pySyringe-1.1.1.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "7c4033adcad02838a612d720082f3085", "sha256": "30ebfbab5df576f0dc29c6791ca52c1d1094668f9544e31e48e25de2745d5ebd" }, "downloads": -1, "filename": "pySyringe-1.2.0.tar.gz", "has_sig": false, "md5_digest": "7c4033adcad02838a612d720082f3085", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2120, "upload_time": "2015-12-16T17:53:34", "url": "https://files.pythonhosted.org/packages/0e/34/6310778d496f375e783ba00f8adfa4751caf7b1ec0b259a70f6144547372/pySyringe-1.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7c4033adcad02838a612d720082f3085", "sha256": "30ebfbab5df576f0dc29c6791ca52c1d1094668f9544e31e48e25de2745d5ebd" }, "downloads": -1, "filename": "pySyringe-1.2.0.tar.gz", "has_sig": false, "md5_digest": "7c4033adcad02838a612d720082f3085", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2120, "upload_time": "2015-12-16T17:53:34", "url": "https://files.pythonhosted.org/packages/0e/34/6310778d496f375e783ba00f8adfa4751caf7b1ec0b259a70f6144547372/pySyringe-1.2.0.tar.gz" } ] }