{ "info": { "author": "Jonathan Moss", "author_email": "xirisr@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: Unix", "Programming Language :: Python", "Programming Language :: Python :: 3.6", "Topic :: Other/Nonlisted Topic" ], "description": "Alamanac\n========\n\nA simple service registry for use within HIS, but useful elsewhere.\n\nServices registered must extend an abstract base class, which acts as a contract or interface.\n\n\nUsage\n-----\n\nServices should be defined as follows\n\n\n.. code-block:: python\n\n import abc\n\n class ExampleContract(metaclass=abc.ABCMeta):\n\n @abc.abstractmethod\n def method(self):\n pass\n\n\n class ExampleService(ExampleContract):\n\n def method(self):\n print(\"I'm an example\")\n\n\nThen register an instance of the service:\n\n\n.. code-block:: python\n\n from almanac import services\n\n s = ExampleService()\n services.register(s)\n\n\nFinally, to retrieve a registered service you need to use the contract:\n\n.. code-block:: python\n\n from almanac import services\n\n s = services.get(ExampleContract)\n\n\nErrors and Exceptions\n---------------------\n\nIf you try to register an object as a service which does not have an abstract parent then it will raise an\n`InvalidServiceType` exception.\n\nAttempting to get a service which has not been registered will raise a `ServiceNotFoundError` exception.\n\nAttempting to get a service with anything other than an abstract base class (e.g. the contract) will result in the\nsystem raising an `InvalidContract` exception\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "registry", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "his.almanac", "package_url": "https://pypi.org/project/his.almanac/", "platform": "linux", "project_url": "https://pypi.org/project/his.almanac/", "project_urls": null, "release_url": "https://pypi.org/project/his.almanac/0.0.1/", "requires_dist": null, "requires_python": "", "summary": "A services registry", "version": "0.0.1" }, "last_serial": 2687837, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "6f11a0955963abd3b8d1376570761932", "sha256": "214f92f20d93628c4a3f3dcf5ecf5694524ad48462c6955b93a6b5401fda8f8e" }, "downloads": -1, "filename": "his.almanac-0.0.1.tar.gz", "has_sig": false, "md5_digest": "6f11a0955963abd3b8d1376570761932", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2959, "upload_time": "2017-03-07T03:19:04", "url": "https://files.pythonhosted.org/packages/bc/ae/1ceecb075c9dccbbde7a728adf0f8f78ec3194715b7c1c00a81d106f427c/his.almanac-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6f11a0955963abd3b8d1376570761932", "sha256": "214f92f20d93628c4a3f3dcf5ecf5694524ad48462c6955b93a6b5401fda8f8e" }, "downloads": -1, "filename": "his.almanac-0.0.1.tar.gz", "has_sig": false, "md5_digest": "6f11a0955963abd3b8d1376570761932", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2959, "upload_time": "2017-03-07T03:19:04", "url": "https://files.pythonhosted.org/packages/bc/ae/1ceecb075c9dccbbde7a728adf0f8f78ec3194715b7c1c00a81d106f427c/his.almanac-0.0.1.tar.gz" } ] }