fields

constant#

anyfig.fields.constant(value, strict=False)[source]

Returns a ConstantField

field#

anyfig.fields.field(type_pattern=typing.Any, tests=None)[source]

Returns an InterfaceField

InterfaceField#

class anyfig.fields.InterfaceField(type_pattern=typing.Any, tests=None)[source]

Bases: object

Used to define allowed values for a config-attribute

resolve_fields#

anyfig.fields.resolve_fields(config, cli_name='')[source]

Removes wrapping for InterfaceFields

cli_input#

anyfig.fields.cli_input(type_pattern)[source]

Returns an InputField

validate_fields#

anyfig.fields.validate_fields(config)[source]

Validates that fields has a value

ConstantField#

class anyfig.fields.ConstantField(value, strict)[source]

Bases: anyfig.fields.InterfaceField

Used to define config-attribute that canโ€™t be overriden

InputField#

class anyfig.fields.InputField(type_pattern)[source]

Bases: anyfig.fields.InterfaceField

Used to define required config-attribute from command line input