API Reference

config_functions#

Classes

MasterConfig

Defines functions that goes into every config class

print_utils#

Functions

cli_help

Returns string for config’s cli-arguments with corresponding comments

extract_config_obj_comments

Extracts comments for a config object and any config-class children objects

anyfig_setup#

Functions

config_class

Adds Anyfig functionality to the class and registers it to known config classes

create_config

Instantiates a config class object

init_config

overwrite

Overwrites parameters with input flags

parse_cli_args

Parses command line input arguments.

figutils#

Functions

check_allowed_input_argument

Raises error if the input argument isn’t marked as “allowed”

default_config_attributes

Default attributes every config class instance will have

find_arguments

Returns the arguments and required arguments for a function/class

get_allowed_cli_args

Returns the attribute names that can be be overwritten from command line input.

get_config

Returns the config object that is registered with anyfig

get_config_classes

get_website

is_config_class

Returns True if the config class definition is registered with anyfig

load_config

Loads the config from file

post_init

Recursively calls the post_init method on a config and it’s attributes

register_config_class

Saves the config class name and definition

register_globally

Registers the config with anyfig to be accessible anywhere

save_config

Serialize and saves the config.

unregister_config_classes

Unregisteres config classes with anyfig

fields#

Functions

cli_input

Returns an InputField

constant

Returns a ConstantField

field

Returns an InterfaceField

resolve_fields

Removes wrapping for InterfaceFields

validate_fields

Validates that fields has a value

Classes

ConstantField

Used to define config-attribute that can’t be overriden

InputField

Used to define required config-attribute from command line input

InterfaceField

Used to define allowed values for a config-attribute