{ "info": { "author": "Jakob R\u00f6\u00dfler", "author_email": "roessler@sighalt.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Topic :: Software Development" ], "description": "# pyhooker\n\nLightweight and easy-to-use python dependency injection library\n\nPyhooker is ready to use for Python >=2.7 and >=3.2\n\n[![Build Status](https://travis-ci.org/sighalt/pyhooker.svg?branch=master)](https://travis-ci.org/sighalt/pyhooker)\n\n\n## Installation\n\n```\npip install git+https://github.com/sighalt/pyhooker.git\n```\n\n## Usage\n\n```python\nimport pyhooker\n\n\n# wheel.py\n\nclass IWheel(object):\n pass\n\n\nclass MichelinWheel(IWheel):\n pass\n\n# engine.py\n\nclass IEngine(object):\n pass\n\n\nclass OttoEngine(IEngine):\n pass\n\n\n# car.py\n\nclass ICar(object):\n pass\n\n\nclass Car(ICar):\n\n @pyhooker.inject_params(engine=IEngine, wheel_type=IWheel)\n def __init__(self, engine, wheel_type):\n self.engine = engine\n self.wheel_type = wheel_type\n\n# driver.py\n\nclass Driver(object):\n\n @pyhooker.inject_params(car=ICar)\n def __init__(self, car):\n self.car = car\n\n# __init__.py\n\npyhooker.register(ICar, Car)\npyhooker.register(IEngine, OttoEngine)\npyhooker.register(IWheel, MichelinWheel)\n\ndriver = Driver()\n\nprint(\"The driver is %s\\n... with its car %s\\n... and engine %s\\n... and wheel type %s\" % (driver,\n driver.car,\n driver.car.engine,\n driver.car.wheel_type))\n```\n", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/sighalt/pyhooker/tarball/1.0.1", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/sighalt/pyhooker", "keywords": "DI,dependency injection,inversion of control,IOC", "license": "GPL3", "maintainer": null, "maintainer_email": null, "name": "pyhooker", "package_url": "https://pypi.org/project/pyhooker/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pyhooker/", "project_urls": { "Download": "https://github.com/sighalt/pyhooker/tarball/1.0.1", "Homepage": "https://github.com/sighalt/pyhooker" }, "release_url": "https://pypi.org/project/pyhooker/1.0.1/", "requires_dist": null, "requires_python": null, "summary": "Just another python DI library.", "version": "1.0.1" }, "last_serial": 2412929, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "a085810bfa8ee21dd9d5ed8bf6fc2e0d", "sha256": "d2e734197d9bcfe0610c1c17b8144aabf7486da64ff1ecc4244ad699a71afa85" }, "downloads": -1, "filename": "pyhooker-1.0.1.tar.gz", "has_sig": false, "md5_digest": "a085810bfa8ee21dd9d5ed8bf6fc2e0d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25680, "upload_time": "2016-10-20T13:42:59", "url": "https://files.pythonhosted.org/packages/8b/a5/69a58844c2e9225ee73b50f8d983039de4f31dca5cf9024bae74bbf83cbb/pyhooker-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a085810bfa8ee21dd9d5ed8bf6fc2e0d", "sha256": "d2e734197d9bcfe0610c1c17b8144aabf7486da64ff1ecc4244ad699a71afa85" }, "downloads": -1, "filename": "pyhooker-1.0.1.tar.gz", "has_sig": false, "md5_digest": "a085810bfa8ee21dd9d5ed8bf6fc2e0d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25680, "upload_time": "2016-10-20T13:42:59", "url": "https://files.pythonhosted.org/packages/8b/a5/69a58844c2e9225ee73b50f8d983039de4f31dca5cf9024bae74bbf83cbb/pyhooker-1.0.1.tar.gz" } ] }