luigi.configuration.cfg_parser module

luigi.configuration provides some convenience wrappers around Python’s ConfigParser to get configuration options from config files.

The default location for configuration files is luigi.cfg (or client.cfg) in the current working directory, then /etc/luigi/client.cfg.

Configuration has largely been superseded by parameters since they can do essentially everything configuration can do, plus a tighter integration with the rest of Luigi.

See Configuration for more info.

exception luigi.configuration.cfg_parser.InterpolationMissingEnvvarError(option, section, value, envvar)[source]

Bases: ConfigParser.InterpolationError

Raised when option value refers to a nonexisting environment variable.

class luigi.configuration.cfg_parser.EnvironmentInterpolation[source]

Bases: object

Custom interpolation which allows values to refer to environment variables using the ${ENVVAR} syntax.

before_get(parser, section, option, value, defaults)[source]
class luigi.configuration.cfg_parser.CombinedInterpolation(interpolations)[source]

Bases: object

Custom interpolation which applies multiple interpolations in series.

Parameters:interpolations – a sequence of configparser.Interpolation objects.
before_get(parser, section, option, value, defaults)[source]
before_read(parser, section, option, value)[source]
before_set(parser, section, option, value)[source]
before_write(parser, section, option, value)[source]
class luigi.configuration.cfg_parser.LuigiConfigParser(defaults=None, dict_type=<class 'collections.OrderedDict'>, allow_no_value=False)[source]

Bases: luigi.configuration.base_parser.BaseParser, ConfigParser.ConfigParser

NO_DEFAULT = <object object>
enabled = True
classmethod reload()[source]
has_option(section, option)[source]

modified has_option Check for the existence of a given option in a given section. If the specified ‘section’ is None or an empty string, DEFAULT is assumed. If the specified ‘section’ does not exist, returns False.

get(section, option, default=<object object>, **kwargs)[source]
getboolean(section, option, default=<object object>)[source]
getint(section, option, default=<object object>)[source]
getfloat(section, option, default=<object object>)[source]
set(section, option, value=None)[source]