{ "info": { "author": "Thomas Spycher", "author_email": "tspycher@zerodine.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7" ], "description": "Python Service Container\n========================\n\nThis is a pretty trivial service container with the ability to register Services in it. On\nretrieval of an registered service the class got instantiated and behaves as a singleton.\n\n```\n from servicecontainer import Service, Container, ServiceInterface\n\n # This is a sample service\n class ExampleService(object):\n val = None\n def __init__(self, param1):\n self.val = param1\n\n class ExampleService2(ServiceInterface):\n val = None\n def __init__(self, param1):\n self.val = param1\n\n @classmethod\n def asService(cls, parameters):\n return Service(\"testservice2\", cls, parameters)\n\n # Create the container\n c = Container()\n\n # build an service\n s = Service(\"testservice\", ExampleService, {\"param1\": \"param1_value\"})\n\n # add the service to the container\n c.add(s)\n c.add(ExampleService2.asService({\"param1\": \"param1_value\"}))\n\n # retrive the service from the container (gots instantiated at this point)\n instance = c.get('testservice')\n self.assertEqual('param1_value', instance.val)\n\n # list all services\n list = c.list()\n self.assertEqual(2, len(list))\n self.assertEqual(list[0], 'testservice')\n\n # be sure its the same instance\n instance2 = c.get('testservice')\n assert instance is instance2\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/zerodine/python-ServiceContainer", "keywords": "container di service", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "python-servicecontainer", "package_url": "https://pypi.org/project/python-servicecontainer/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/python-servicecontainer/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/zerodine/python-ServiceContainer" }, "release_url": "https://pypi.org/project/python-servicecontainer/1.0.2/", "requires_dist": null, "requires_python": null, "summary": "A simple and small service container", "version": "1.0.2" }, "last_serial": 1597359, "releases": { "1.0.2": [ { "comment_text": "", "digests": { "md5": "36c43e9ddf2164504687fa031be2a909", "sha256": "dc630c696044e17ff94afd33d0aef4724d722247fdf9f9af7015478585e58efb" }, "downloads": -1, "filename": "python_servicecontainer-1.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "36c43e9ddf2164504687fa031be2a909", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 4428, "upload_time": "2015-06-18T13:11:03", "url": "https://files.pythonhosted.org/packages/e0/e5/c017efe05b5f387f52bd9e7fff35284d37731ec9e3e19f3a704917727a9e/python_servicecontainer-1.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "210809152db778b65bffd8f14739194f", "sha256": "7f4224fd080b5a713205763b74a562332cb99bb9cacbf028e9b3094c0c71b82d" }, "downloads": -1, "filename": "python-servicecontainer-1.0.2.tar.gz", "has_sig": false, "md5_digest": "210809152db778b65bffd8f14739194f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3752, "upload_time": "2015-06-18T13:10:59", "url": "https://files.pythonhosted.org/packages/59/c3/b06b6d8f597c0cef69db559211033ff619f225cf5b1069a0f35c801146dc/python-servicecontainer-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "36c43e9ddf2164504687fa031be2a909", "sha256": "dc630c696044e17ff94afd33d0aef4724d722247fdf9f9af7015478585e58efb" }, "downloads": -1, "filename": "python_servicecontainer-1.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "36c43e9ddf2164504687fa031be2a909", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 4428, "upload_time": "2015-06-18T13:11:03", "url": "https://files.pythonhosted.org/packages/e0/e5/c017efe05b5f387f52bd9e7fff35284d37731ec9e3e19f3a704917727a9e/python_servicecontainer-1.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "210809152db778b65bffd8f14739194f", "sha256": "7f4224fd080b5a713205763b74a562332cb99bb9cacbf028e9b3094c0c71b82d" }, "downloads": -1, "filename": "python-servicecontainer-1.0.2.tar.gz", "has_sig": false, "md5_digest": "210809152db778b65bffd8f14739194f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3752, "upload_time": "2015-06-18T13:10:59", "url": "https://files.pythonhosted.org/packages/59/c3/b06b6d8f597c0cef69db559211033ff619f225cf5b1069a0f35c801146dc/python-servicecontainer-1.0.2.tar.gz" } ] }