As already mentioned earlier, plugins are Python packages which provide certain pieces of metadata to tell OctoPrint’s
plugin subsystem about themselves. These are simple package attributes defined in the top most package file, e.g.:

importoctoprint.plugin# ...__plugin_name__="My Plugin"def__plugin_load__():# whatever you need to do to load your plugin, if anything at allpass

The following properties are recognized:

__plugin_name__

Name of your plugin, optional, overrides the name specified in setup.py if provided. If neither this property nor
a name from setup.py is available to the plugin subsystem, the plugin’s identifier (= package name) will be
used instead.

__plugin_version__

Version of your plugin, optional, overrides the version specified in setup.py if provided.

__plugin_description__

Description of your plugin, optional, overrides the description specified in setup.py if provided.

__plugin_author__

Author of your plugin, optional, overrides the author specified in setup.py if provided.

__plugin_url__

URL of the webpage of your plugin, e.g. the Github repository, optional, overrides the URL specified in setup.py if
provided.

__plugin_license__

License of your plugin, optional, overrides the license specified in setup.py if provided.

defhandle_gcode_sent(comm_instance,phase,cmd,cmd_type,gcode,*args,**kwargs):ifgcodein("M106","M107"):importlogginglogging.getLogger(__name__).info("We just sent a fan command to the printer!")__plugin_hooks__={"octoprint.comm.protocol.gcode.sent":handle_gcode_sent}

__plugin_check__

Method called upon discovery of the plugin by the plugin subsystem, should return True if the
plugin can be instantiated later on, False if there are reasons why not, e.g. if dependencies
are missing. An example:

def__plugin_check__():# Make sure we only run our plugin if some_dependency is availabletry:importsome_dependencyexceptImportError:returnFalsereturnTrue

__plugin_load__

Method called upon loading of the plugin by the plugin subsystem, can be used to instantiate
plugin implementations, connecting them to hooks etc. An example:

Method called upon unloading of the plugin by the plugin subsystem, can be used to do any final clean ups.

__plugin_enable__

Method called upon enabling of the plugin by the plugin subsystem. Also see on_plugin_enabled().

__plugin_disable__

Method called upon disabling of the plugin by the plugin subsystem. Also see on_plugin_disabled().

__plugin_settings_overlay__

An optional dict providing an overlay over the application’s default settings. Plugins can use that to modify the
default settings of OctoPrint and its plugins that apply when there’s no different configuration present in config.yaml. Note that config.yaml
has the final say - it is not possible to override what is in there through an overlay. Plugin authors should use this
sparingly - it’s supposed to be utilized when creating specific customization of the core application that necessitate
changes in things like e.g. standard naming, UI ordering or API endpoints. Example: