glorpen.config
API Documentation¶
glorpen.config
¶
-
glorpen.config.
__version__
¶ Current package version.
glorpen.config.fields.base
¶
-
class
glorpen.config.fields.base.
Field
(validators=None)[source]¶ Single field in configuration file.
Custom fields should implement own normalizer/interpolation by overriding corresponding methods.
To add custom validation based on whole config object use
validator()
.
glorpen.config.fields.simple
¶
-
class
glorpen.config.fields.simple.
Dict
(schema=None, keys=None, values=None, check_keys=False, **kwargs)[source]¶ Converts values to
collections.OrderedDict
Supports setting whole schema (specific keys and specific values) or just keys type and values type.
Keys can be interpolated if
keys
param supports it.
-
class
glorpen.config.fields.simple.
List
(schema, check_values=False, **kwargs)[source]¶ Converts value to list.
-
class
glorpen.config.fields.simple.
Path
(*args, split_by='.', left_char='{', right_char='}', **kwargs)[source]¶ Converts given value to disk path.
-
class
glorpen.config.fields.simple.
PathObj
(*args, split_by='.', left_char='{', right_char='}', **kwargs)[source]¶ Converts value to
pathlib.Path
object.
-
class
glorpen.config.fields.simple.
String
(*args, split_by='.', left_char='{', right_char='}', **kwargs)[source]¶ Converts value to string.
-
class
glorpen.config.fields.simple.
Variant
(schema, *args, **kwargs)[source]¶ Converts value to normalized state using one
Field
chosen from multiple provided.To allow blank values you have to pass child field with enabled blank values. First field which supports value (
Field.is_value_supported()
) will be used to convert it.