Base class to load Flowbber plugins.

All Flowbber component loaders extend from the PluginLoader class.


class flowbber.loaders.loader.PluginLoader(component, api_version='1.0')

Plugin loader utility class.

This class allows to load plugins using Python entry points.

  • component (str) – Name of the component.
  • api_version (str) – Version of the API.


Inheritance diagram of PluginLoader


Load all available plugins.

This function load all available plugins by discovering installed plugins registered in the entry point. This can be costly or error prone if the package that declared the entrypoint misbehave. Because of this a cache is stored after the first call.

cache (bool) – If True return the cached result. If False force reload of all plugins registered for the entry point.
An ordered dictionary associating the name of the plugin and the class (subclass of flowbber.components.Component) implementing it.
Return type
classmethod register(key)

Register a plugin locally.

This method is expected to be used as a decorator. It allows to register a plugin locally without having to create a full Python package to use entrypoints.


from flowbber.loaders import source
from flowbber.components.source import Source

class MySource(Source):
    def collect(self):
        return {'my_value': 1000}

Same apply for aggregators and sinks.