{ "info": { "author": "Miguel \u00c1ngel Garc\u00eda", "author_email": "miguelangel.garcia@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent" ], "description": "============== =============== ========= ============\nVERSION DOWNLOADS TESTS COVERAGE\n============== =============== ========= ============\n|pip version| |pip downloads| |travis| |coveralls|\n============== =============== ========= ============\n\nGoal and Philosophy\n===================\n\n**Pluginloader** is a library to allow an easy way to **load plugins**. They can be managed by interfaces or just method validators.\n\nFeatures\n--------\n\n- Each plugin can be instanciated **several times**.\n- **Customizable filter** to select if a class should be loaded as a plugin.\n- **Sandboxed**: plugins cannot access the main program or other plugins by default, because they are loaded in isolated environments.\n- **Parameterizable context**: Sometimes you need to pass some classes, functions or variables preloaded to the plugins. It is possible and easy.\n\n\nDocumentation\n=============\n\nInstallation\n------------\n\nTwo options: to install it in your system/project::\n\n pip install pluginloader\n\nUsage\n-----\n\nYou can load all plugins in a file, just doing:\n\n.. code:: python\n\n loader = PluginLoader()\n plugins = loader.load_file('plugins.py')\n\nWith those simple lines you will have in the variable :code:`plugins` a dictionary with each class inside the ``plugins.py`` file as key and a factory as value.\n\nLet's see an example. Using the ``plugins.py`` file:\n\n.. code:: python\n\n class Foo(object):\n pass\n\nWe can have an object of that class just with:\n\n.. code:: python\n\n loader = PluginLoader()\n plugins = loader.load_file('plugins.py')\n instance1 = plugins['Foo']()\n instance2 = plugins['Foo']()\n\nSimple and easy.\n\nAPI\n---\n\nThis is a simple module with a simple API. It just contains one class, :code:`PluginLoader`, with these public methods:\n\n:code:`load_file(filename, onlyif=None, context=None)`\n//////////////////////////////////////////////////////\n\nLoads all plugins in a file.\n\nParameters:\n\n- ``filename``: File name to be loaded.\n- ``onlyif``: Value or function that will be called with each class found. It will skip the plugin if this function returns :code:`False`.\n- ``context``: Dict with the context where the method should be loaded in. It usually will map a class, function or variable name to the class, function or value in the main program, so it can be used within the plugin.\n\n\n:code:`load_directory(path, onlyif=None, recursive=False))`\n///////////////////////////////////////////////////////////\n\nLoads all plugins in a directory.\n\nParameters:\n\n- ``path``: Path where plugins are in.\n- ``onlyif``: Value or function that will be called with each class found. It will skip the plugin if this function returns :code:`False`.\n- ``recursive``: Boolean value to allow recursive read of directories.\n- ``context``: Dict with the context where the method should be loaded in.\n\nLinks will always be ignored.\n\n\nLicense\n=======\n\nCopyright (c) 2014 Miguel \u00c1ngel Garc\u00eda (`@magmax9`_).\n\nLicensed under `the MIT license`_.\n\n\n.. |travis| image:: https://travis-ci.org/magmax/python-pluginloader.png\n :target: `Travis`_\n :alt: Travis results\n\n.. |coveralls| image:: https://coveralls.io/repos/magmax/python-pluginloader/badge.png\n :target: `Coveralls`_\n :alt: Coveralls results_\n\n.. |pip version| image:: https://pypip.in/v/pluginloader/badge.png\n :target: https://pypi.python.org/pypi/pluginloader\n :alt: Latest PyPI version\n\n.. |pip downloads| image:: https://pypip.in/d/pluginloader/badge.png\n :target: https://pypi.python.org/pypi/pluginloader\n :alt: Number of PyPI downloads\n\n.. _Travis: https://travis-ci.org/magmax/python-pluginloader\n.. _Coveralls: https://coveralls.io/r/magmax/python-pluginloader\n\n.. _@magmax9: https://twitter.com/magmax9\n\n.. _the MIT license: http://opensource.org/licenses/MIT\n.. _download the lastest zip: https://pypi.python.org/pypi/pluginloader", "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/magmax/python-pluginloader", "keywords": "plugin,plugins,extension,extensions,engine,loader", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "pluginloader", "package_url": "https://pypi.org/project/pluginloader/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pluginloader/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/magmax/python-pluginloader" }, "release_url": "https://pypi.org/project/pluginloader/0.1.3/", "requires_dist": null, "requires_python": null, "summary": "Library to manage plugins/extensions in your applications.", "version": "0.1.3" }, "last_serial": 1113436, "releases": { "0.0.0": [], "0.1.0": [ { "comment_text": "", "digests": { "md5": "5208d271599f32969b2d61873027071f", "sha256": "d4dd6286e9d46c975e1760b210643cde71cdfcaa4555a28ffb95729706ce5daf" }, "downloads": -1, "filename": "pluginloader-0.1.0.tar.gz", "has_sig": false, "md5_digest": "5208d271599f32969b2d61873027071f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3180, "upload_time": "2014-05-22T20:49:40", "url": "https://files.pythonhosted.org/packages/e9/3f/2fe3832035aa20579d4470835c6a1879c5a7ab735130c22bf1eeeafaf0b5/pluginloader-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "e8bf69b6816f333c97240707a591ee67", "sha256": "d373364e3bc3e34418edebe1802b74a9aae6e9bcfbcfbfe81ade47d0ec1e81bb" }, "downloads": -1, "filename": "pluginloader-0.1.1.tar.gz", "has_sig": false, "md5_digest": "e8bf69b6816f333c97240707a591ee67", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3173, "upload_time": "2014-05-22T21:02:25", "url": "https://files.pythonhosted.org/packages/88/cc/aae6cfb4a865f225873bd45a0d4130b23a8c4bb7a2334de549888e9cf4b9/pluginloader-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "4a37f1a824d2ad1eb7feec3ec3b77b7d", "sha256": "b62e3c88ac88110559593628e3c4f768f0157cf0e31a4d57b75bfffe14b742d9" }, "downloads": -1, "filename": "pluginloader-0.1.2.tar.gz", "has_sig": false, "md5_digest": "4a37f1a824d2ad1eb7feec3ec3b77b7d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3317, "upload_time": "2014-06-04T06:40:09", "url": "https://files.pythonhosted.org/packages/47/f7/a5008140063b72a6e39fb882249990ecd03392df8c8322ba412dd80918c1/pluginloader-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "47585385bca4ad7466e28f4f4a91a6fc", "sha256": "239c915bfd9ab470c70090552bea73110e8d7cdb6da2c5fe196c725f8c7e7017" }, "downloads": -1, "filename": "pluginloader-0.1.3.tar.gz", "has_sig": false, "md5_digest": "47585385bca4ad7466e28f4f4a91a6fc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3392, "upload_time": "2014-06-04T06:58:43", "url": "https://files.pythonhosted.org/packages/43/50/eafa596023c5a534e1d1a7ee2f9d1a866c83a16fcdd3322fdf589d5469a5/pluginloader-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "47585385bca4ad7466e28f4f4a91a6fc", "sha256": "239c915bfd9ab470c70090552bea73110e8d7cdb6da2c5fe196c725f8c7e7017" }, "downloads": -1, "filename": "pluginloader-0.1.3.tar.gz", "has_sig": false, "md5_digest": "47585385bca4ad7466e28f4f4a91a6fc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3392, "upload_time": "2014-06-04T06:58:43", "url": "https://files.pythonhosted.org/packages/43/50/eafa596023c5a534e1d1a7ee2f9d1a866c83a16fcdd3322fdf589d5469a5/pluginloader-0.1.3.tar.gz" } ] }