Cement core plugins module.

class cement.core.plugin.CementPluginHandler(*args, **kw)

Bases: cement.core.handler.CementBaseHandler

Base class that all Plugin Handlers should sub-class from.

class Meta

Handler meta-data (can be passed as keyword arguments to the parent class).


The interface that this class implements.

alias of IPlugin

label = None

The string identifier of this handler.

class cement.core.plugin.IPlugin

Bases: cement.core.interface.Interface

This class defines the Plugin Handler Interface. Classes that implement this handler must provide the methods and attributes defined below.

Implementations do not subclass from interfaces.


from cement.core import plugin

class MyPluginHandler(object):
    class Meta:
        interface = plugin.IPlugin
        label = 'my_plugin_handler'

The _setup function is called during application initialization and must ‘setup’ the handler object making it ready for the framework or the application to make further calls to it.

Parameters:app_obj – The application object.

Returns a list of plugins that are disabled in the config.


Returns a list of plugins that are enabled in the config.


Returns a list of plugins that have been loaded.


Load a plugin whose name is ‘plugin_name’.

Parameters:plugin_name – The name of the plugin to load.

Load all plugins from plugin_list.

Parameters:plugin_list – A list of plugin names to load.
cement.core.plugin.plugin_validator(klass, obj)

Validates an handler implementation against the IPlugin interface.