pluginmgr


Namepluginmgr JSON
Version 1.0.1 PyPI version JSON
download
home_page
Summarylightweight python plugin system supporting config inheritance
upload_time2021-01-13 19:38:01
maintainer
docs_urlNone
author20C
requires_python>=3.6,<4.0
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# pluginmgr


[![PyPI](https://img.shields.io/pypi/v/pluginmgr.svg?maxAge=3600)](https://pypi.python.org/pypi/pluginmgr)
[![PyPI](https://img.shields.io/pypi/pyversions/pluginmgr.svg?maxAge=3600)](https://pypi.python.org/pypi/pluginmgr)
[![Tests](https://github.com/20c/pluginmgr/workflows/tests/badge.svg)](https://github.com/20c/pluginmgr)
[![Codecov](https://img.shields.io/codecov/c/github/20c/pluginmgr/master.svg?maxAge=3600)](https://codecov.io/github/20c/pluginmgr)


lightweight python plugin system supporting config inheritance


## To use

There is a full example at <https://github.com/20c/pluginmgr/tree/master/tests/pluginmgr_test>

Create the manager, for example in a module `__init__.py` file

```python
import pluginmgr

# this is the namespace string that import uses
namespace = 'pluginmgr_test.plugins'

# directories to look in, string or list of strings
searchpath = 'path/to/search/in'

# determines if this should create a blank loader to import through. This
# should be enabled if there isn't a real module path for the namespace and
# disabled for sharing the namespace with static modules
# default is False
create_loader = False

plugin = pluginmgr.PluginManager(namespace, searchpath, create_loader)
```

Create and register a plugin, note the filename needs to be the same as registered name

```python
from pluginmgr_test import plugin


# register a plugin named mod0
@plugin.register('mod0')
class Mod0(pluginmgr.PluginBase):
    pass
```

See the dict containing all registered plugins

```python
from pluginmgr_test import plugin

# dict of all registered plugins
print(plugin.registry)
```



            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pluginmgr",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "20C",
    "author_email": "code@20c.com",
    "download_url": "https://files.pythonhosted.org/packages/ab/92/88ea403e0b000b3bac12cb3eca0b0b728ae79a39a0e2b06911df0472d91e/pluginmgr-1.0.1.tar.gz",
    "platform": "",
    "description": "\n# pluginmgr\n\n\n[![PyPI](https://img.shields.io/pypi/v/pluginmgr.svg?maxAge=3600)](https://pypi.python.org/pypi/pluginmgr)\n[![PyPI](https://img.shields.io/pypi/pyversions/pluginmgr.svg?maxAge=3600)](https://pypi.python.org/pypi/pluginmgr)\n[![Tests](https://github.com/20c/pluginmgr/workflows/tests/badge.svg)](https://github.com/20c/pluginmgr)\n[![Codecov](https://img.shields.io/codecov/c/github/20c/pluginmgr/master.svg?maxAge=3600)](https://codecov.io/github/20c/pluginmgr)\n\n\nlightweight python plugin system supporting config inheritance\n\n\n## To use\n\nThere is a full example at <https://github.com/20c/pluginmgr/tree/master/tests/pluginmgr_test>\n\nCreate the manager, for example in a module `__init__.py` file\n\n```python\nimport pluginmgr\n\n# this is the namespace string that import uses\nnamespace = 'pluginmgr_test.plugins'\n\n# directories to look in, string or list of strings\nsearchpath = 'path/to/search/in'\n\n# determines if this should create a blank loader to import through. This\n# should be enabled if there isn't a real module path for the namespace and\n# disabled for sharing the namespace with static modules\n# default is False\ncreate_loader = False\n\nplugin = pluginmgr.PluginManager(namespace, searchpath, create_loader)\n```\n\nCreate and register a plugin, note the filename needs to be the same as registered name\n\n```python\nfrom pluginmgr_test import plugin\n\n\n# register a plugin named mod0\n@plugin.register('mod0')\nclass Mod0(pluginmgr.PluginBase):\n    pass\n```\n\nSee the dict containing all registered plugins\n\n```python\nfrom pluginmgr_test import plugin\n\n# dict of all registered plugins\nprint(plugin.registry)\n```\n\n\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "lightweight python plugin system supporting config inheritance",
    "version": "1.0.1",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "0124b6ed397a5e4dce08367b757f5fe7",
                "sha256": "1f24786c2cac55e17f3496bd915b8c336792ecc9edb2b61ea5f73ce3a8a1eec9"
            },
            "downloads": -1,
            "filename": "pluginmgr-1.0.1-py3-none-any.whl",
            "has_sig": true,
            "md5_digest": "0124b6ed397a5e4dce08367b757f5fe7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6,<4.0",
            "size": 9153,
            "upload_time": "2021-01-13T19:37:59",
            "upload_time_iso_8601": "2021-01-13T19:37:59.975542Z",
            "url": "https://files.pythonhosted.org/packages/5c/dd/f59a021c5a250d133887e2ea3e3ca34863537cab21bbcd7a08ab2160b387/pluginmgr-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "0b5943ab9c3d03c1a87972ae63f99e02",
                "sha256": "151c8afe8df535f2e02255433cd3340000b3428018692f0581ff53d6f74c3630"
            },
            "downloads": -1,
            "filename": "pluginmgr-1.0.1.tar.gz",
            "has_sig": true,
            "md5_digest": "0b5943ab9c3d03c1a87972ae63f99e02",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6,<4.0",
            "size": 8887,
            "upload_time": "2021-01-13T19:38:01",
            "upload_time_iso_8601": "2021-01-13T19:38:01.432220Z",
            "url": "https://files.pythonhosted.org/packages/ab/92/88ea403e0b000b3bac12cb3eca0b0b728ae79a39a0e2b06911df0472d91e/pluginmgr-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-01-13 19:38:01",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "pluginmgr"
}
        
20C
Elapsed time: 0.18729s