Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sdelements/yantra
A simple plugins manager.
https://github.com/sdelements/yantra
Last synced: about 2 months ago
JSON representation
A simple plugins manager.
- Host: GitHub
- URL: https://github.com/sdelements/yantra
- Owner: sdelements
- License: mit
- Created: 2015-10-29T18:49:42.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2024-08-26T10:12:12.000Z (4 months ago)
- Last Synced: 2024-10-30T11:51:06.894Z (about 2 months ago)
- Language: Python
- Size: 91.8 KB
- Stars: 4
- Watchers: 46
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# yantra
yantra is a simple plugin manager/plugin discovery framework.
## Usage
Let's assume you have a class called BaseReportPlugin which all report plugins derive from.
```python
from yantra import PluginManager, PluginType
from reports import BaseReportPlugin# Define the type
report_type = PluginType(name='report',
base_class=BaseReportPlugin',
path='/plugins/reports/')# Instantiate the manager
plugin_manager = PluginManager([report_type])# Fetch plugins
plugin_manager.get_plugins(report_type)
```You can register multiple plugin types. An alternate way to register plugin types is as follows:
```python
plugin_manager = PluginManager()
plugin_manager.register_plugin_type(foo_type)
```