Skip to main content

Python Plugin Management, simplified

Project description

Build Status Coverage Status Code Climate

python plugin management, simplified.

from pluginmanager import PluginInterface

plugin_interface = PluginInterface()
plugin_interface.set_plugin_directories('my/fancy/plugin/path')
plugin_interface.collect_plugins()

plugins = plugin_interface.get_instances()

Library currently under heavy development and may not be ready for use

Installation

pip install pluginmanager

-or-

pip install git+https://github.com/benhoff/pluginmanager.git

Architecture

pluginmanager was designed to be as extensible as possible while also being easy to use. There are three layers of access.

Interfaces:

public facing

Managers:

extended or replaced

Filters:

implementation specific

Interfaces

Interfaces were used to provide a simple programmer interface while maintaining the ability to separate out the concerns of the implementation. The main interface is the PluginInterface, which is designed to be as stateless as possible, and have interjectable options, where applicable.

PluginInterface provides the cability to instantiate two other interfaces, the BlacklistInterface and FilterInterface. These interfaces provide universal access to the blacklisting (selectively implemented) and filtering APIs respectively.

Managers

There are four managers which make up the core of the library.

DirectoryManager:

Maintains directory state. Responsbile for recursively searching through directories

FileManager:

Can maintain filepath state. Does maintain file filter state. Responsible for applying file filters to filepaths passed gotten from directories

ModuleManager:

Loads modules from source code. Keeps track of loaded modules. Maintains module filter state. Responsible for applying module filters to modules to get out plugins.

PluginManager:

Instantiates plugins. Maintains plugin state.

Filters

Filters are designed to offer implementation-level extensiblity. Want to only return only files start with “plugin”? Create a filter for it. Or use some of the provided filters to provide the desired implementation.

NOTE: Final implementation of filters and how they interact with the library is currently a WIP and should be considered unstable.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pluginmanager-0.1.0.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pluginmanager-0.1.0-py3-none-any.whl (68.7 kB view details)

Uploaded Python 3

File details

Details for the file pluginmanager-0.1.0.tar.gz.

File metadata

  • Download URL: pluginmanager-0.1.0.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pluginmanager-0.1.0.tar.gz
Algorithm Hash digest
SHA256 234d2c8faf05b2dec7fe6a5ac479a2f55920dcc780588554d82617cd04a084dd
MD5 ca1949e16f0dc0028f5288adae256e7c
BLAKE2b-256 8933875a480f82f4d073ceb563d28f37c3f2e1673f5e876be0d0a1a070757429

See more details on using hashes here.

File details

Details for the file pluginmanager-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pluginmanager-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 02baff1b81441cde1d378c28922875ab235bdb51a2ab3d200ffb072803055c89
MD5 f29be1f9a38c5cc5cd57e3cb51679e54
BLAKE2b-256 58fc5e6826d4f8e2419f95ca8cdbaf774752fe4e2c3b9ef9133e70758dd68622

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page