{ "info": { "author": "Dave Evans", "author_email": "evansde77.github@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "Pluggage\n========\n\nA Utility library for using plugins with python\nThere are two ways to use this library to dynamically load objects, \na lightweight load-on-demand via a dictionary interface and a heavier\nfactory pattern using a base class to register objects with a factory. \n\nLightweight Plugins\n===================\n\nThe lightweight plugin system uses a dictionary API to load dot-delimited names \nand either return the object or optionally call it. \n\n\n.. code-block:: python\n \n from pluggage.plugins import Plugins \n loader = Plugins()\n \n # load references to objects\n func_ref = loader['some_module.some_submodule.some_function'] \n cls_ref = loader['some_module.some_submodule.SomeClass'] \n \n # call the objects and get the results\n func_result = loader('some_module.some_submodule.some_function', *func_args, **func_kwargs)\n someclass_instance = loader('some_module.some_submodule.SomeClass', *ctor_args, **ctor_kwargs)\n\n\nHeavyweight Plugins\n=================== \n\nThe Heavyweight Plugins are implemented via a metaclass registry that allows classes \nto be registered as plugins on import, and then accessed via a named factory. \nClasses inheriting from the base plugin class specify which factory they will be registered with \nand by default will register under that factory with their class name, or that can also be overridden by inheritance. \nThe plugins can be accessed using a get_factory call provided in the pluggage.registry module. \n\n.. code-block:: python\n\n factory = get_factory('my_factory')\n some_class_instance = factory('SomeClass', *ctor_args, **ctor_kwargs)\n \n \nTo register a class with a factory, inherit from the PluggagePlugin class and set the PLUGGAGE_FACTORY_NAME class attribute:\n\n\n.. code-block:: python\n\n from pluggage.factory_plugin import PluggagePlugin\n\n class SomeClass(PluggagePlugin):\n \"\"\"\n sample plugin\n \"\"\"\n PLUGGAGE_FACTORY_NAME = 'my_factory'\n def __init__(self, value):\n self.value = value\n def __call__(self):\n print(value)\n \n factory = get_factory('my_factory')\n some_class_instance = factory('SomeClass', 'abc')\n some_class_instance() # prints 'abc'\n\n\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://pluggage.readthedocs.org/en/latest/", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "pluggage", "package_url": "https://pypi.org/project/pluggage/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pluggage/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://pluggage.readthedocs.org/en/latest/" }, "release_url": "https://pypi.org/project/pluggage/0.0.4/", "requires_dist": null, "requires_python": null, "summary": "Plugin, dynamic loading and factory utility library", "version": "0.0.4" }, "last_serial": 1778726, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "d2c8a084f8a1c18eeed748f466f8ca7a", "sha256": "fe8aaa52818466d111abc125ef067f90ff951d3180df6027b7d4b5cfb51ace62" }, "downloads": -1, "filename": "pluggage-0.0.1.tar.gz", "has_sig": false, "md5_digest": "d2c8a084f8a1c18eeed748f466f8ca7a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5107, "upload_time": "2015-09-10T14:21:10", "url": "https://files.pythonhosted.org/packages/0d/a2/d3d9999c29a8fc6cd2cc75372190a9efc8583b2d8bf939b02a000ddd5c02/pluggage-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "de29a47b45c7214d6f95b0cfc337e0fd", "sha256": "9cf433ef833cb66cb393c70ca20ae03387e96ed954eac74a572c6ed70f7cff62" }, "downloads": -1, "filename": "pluggage-0.0.2.tar.gz", "has_sig": false, "md5_digest": "de29a47b45c7214d6f95b0cfc337e0fd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5154, "upload_time": "2015-09-22T21:08:02", "url": "https://files.pythonhosted.org/packages/83/1e/f4701df713d9af4c367586fa4e11911dbf483bd932a2470737e650a297f6/pluggage-0.0.2.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "665937e1b369e35dc8192519215e80cb", "sha256": "3eeb940344f72ffd99e9568fe9f9588707952f2b626143df62dfe056c75316fc" }, "downloads": -1, "filename": "pluggage-0.0.4.tar.gz", "has_sig": false, "md5_digest": "665937e1b369e35dc8192519215e80cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4993, "upload_time": "2015-10-20T19:42:34", "url": "https://files.pythonhosted.org/packages/96/8f/38f2322af6f6204e6c01eba7a6cee7b691f0e8180806b4a9175d6731387d/pluggage-0.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "665937e1b369e35dc8192519215e80cb", "sha256": "3eeb940344f72ffd99e9568fe9f9588707952f2b626143df62dfe056c75316fc" }, "downloads": -1, "filename": "pluggage-0.0.4.tar.gz", "has_sig": false, "md5_digest": "665937e1b369e35dc8192519215e80cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4993, "upload_time": "2015-10-20T19:42:34", "url": "https://files.pythonhosted.org/packages/96/8f/38f2322af6f6204e6c01eba7a6cee7b691f0e8180806b4a9175d6731387d/pluggage-0.0.4.tar.gz" } ] }