Name | pluginmgr JSON |
Version |
1.2.1
JSON |
| download |
home_page | None |
Summary | lightweight python plugin system supporting config inheritance |
upload_time | 2024-10-25 20:31:32 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | Apache-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)
[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/20c/pluginmgr.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/20c/pluginmgr/context:python)
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": null,
"name": "pluginmgr",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "20C <code@20c.com>",
"download_url": "https://files.pythonhosted.org/packages/f3/f4/79b24459b62bcf4fb802fdc74da36703165ce1a5979395f5d22b9f0f5c45/pluginmgr-1.2.1.tar.gz",
"platform": null,
"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[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/20c/pluginmgr.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/20c/pluginmgr/context:python)\n\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",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "lightweight python plugin system supporting config inheritance",
"version": "1.2.1",
"project_urls": {
"repository": "https://github.com/20c/pluginmgr"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "19905423e558b63ac6002396ab6b3b03ee8d548c55731dad4e86608b4bc22507",
"md5": "0d88a79058e09873decc6be0ed471794",
"sha256": "ee9ca530ad1a369c43cb4486fa6815d2fc99f9bc598d42414f96a98b36fc80c2"
},
"downloads": -1,
"filename": "pluginmgr-1.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0d88a79058e09873decc6be0ed471794",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 9559,
"upload_time": "2024-10-25T20:31:30",
"upload_time_iso_8601": "2024-10-25T20:31:30.966928Z",
"url": "https://files.pythonhosted.org/packages/19/90/5423e558b63ac6002396ab6b3b03ee8d548c55731dad4e86608b4bc22507/pluginmgr-1.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f3f479b24459b62bcf4fb802fdc74da36703165ce1a5979395f5d22b9f0f5c45",
"md5": "3b627655e24bde4041a1fc88e7e001be",
"sha256": "eb4f78521861224e79ce045e6f97ffa06a347b955e6e69e44716acda4ca024d4"
},
"downloads": -1,
"filename": "pluginmgr-1.2.1.tar.gz",
"has_sig": false,
"md5_digest": "3b627655e24bde4041a1fc88e7e001be",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 73660,
"upload_time": "2024-10-25T20:31:32",
"upload_time_iso_8601": "2024-10-25T20:31:32.559712Z",
"url": "https://files.pythonhosted.org/packages/f3/f4/79b24459b62bcf4fb802fdc74da36703165ce1a5979395f5d22b9f0f5c45/pluginmgr-1.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-25 20:31:32",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "20c",
"github_project": "pluginmgr",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"landscape": true,
"tox": true,
"lcname": "pluginmgr"
}