strict_config library

Library for extracting values from a config.

Use the ConfigMap class to parse config text and extract values from it.

The LoggerConfig class extracts logger levels from a ConfigMap, and use them to setup loggers with the logging package. This allows loggers to be controlled through a config, instead of with hard-coded levels.

Classes

ConfigMap
Represents a config item with keys and values.
LoggerConfig
Configuration of logger levels.

Enums

ConfigType
Possible types returned by ConfigMap.type.

Exceptions / Errors

ConfigException
Base class for all config exceptions.
ConfigExceptionFormat
Indicates a syntax error in the config.
ConfigExceptionKey
Indicates a problem with a config item.
ConfigExceptionKeyMissing
Indicates a key is missing.
ConfigExceptionKeyUnexpected
Indicates a key is unexpected.
ConfigExceptionValue
Indicates a problem with the value associated with a config item.
ConfigExceptionValueEmptyList
Indicates the value is a list, but it is empty.