pip_services3_commons.config.IConfigurable module


Interface for components that require configuration


Conceptual Vision Consulting LLC 2018-2019, see AUTHORS for more details.


MIT, see LICENSE for more details.

class pip_services3_commons.config.IConfigurable.IConfigurable

Bases: abc.ABC

An interface to set configuration parameters to an object.

It can be added to any existing class by implementing a single configure() method.

If you need to emphasis the fact that configure() method can be called multiple times to change object configuration in runtime, use IReconfigurable interface instead.


class MyClass(IConfigurable):
   _myParam = "default args"

def configure(self, config):
   self._myParam = config.get_as_string_with_default("options.param", myParam)
configure(config: pip_services3_commons.config.ConfigParams.ConfigParams)

Configures object by passing configuration parameters.


config – configuration parameters to be set.