# cpl.configuration — Common Python Library documentation

# cpl.configuration

## cpl.configuration.configuration

class `cpl.configuration.configuration.``Configuration`

  Bases: `cpl.configuration.configuration_abc.ConfigurationABC`

  `add_configuration`(key_type: Union[str, type], value: cpl.configuration.configuration_model_abc.ConfigurationModelABC )

    Add configuration object

    > key_type: Union[`str`, `type`]

    >   Type of the value

    > value: `cpl.configuration.configuration_model_abc.ConfigurationModelABC`

    >   Object of the value

  `add_console_argument`(argument: cpl.configuration.console_argument.ConsoleArgument )

    Adds console argument to known console arguments

    > argument: `cpl.configuration.console_argument.ConsoleArgument`

    >   Specifies the console argument

  `add_console_arguments`(error: Optional[bool] = None)

    Reads the console arguments

    > error: `bool`

    >   Defines is invalid argument error will be shown or not

  `add_environment_variables`(prefix: str)

    Reads the environment variables

    > prefix: `str`

    >   Prefix of the variables

  `add_json_file`(name: str, optional: Optional[bool] = None, output: bool = True, path: Optional[str] = None)

    Reads and saves settings from given json file

    > name: `str`

    >   Name of the file

    > optional: `str`

    >   Specifies whether an error should occur if the file was not found

    > output: `bool`

    >   Specifies whether an output should take place

    > path: `str`

    >   Path in which the file should be stored

  property `additional_arguments`
  property `argument_error_function`
  property `environment`
  `get_configuration`(search_type: Union[str, Type[ cpl.configuration.configuration_model_abc.ConfigurationModelABC ]]) → Union[str, collections.abc.Callable[ cpl.configuration.configuration_model_abc.ConfigurationModelABC ]]

    Returns value from configuration by given type

    > search_type: Union[`str`, Type[`cpl.configuration.configuration_model_abc.ConfigurationModelABC`]]

    >   Type to search for

    > Object of Union[`str`, Callable[`cpl.configuration.configuration_model_abc.ConfigurationModelABC`]]

## cpl.configuration.configuration_abc

class `cpl.configuration.configuration_abc.``ConfigurationABC`

  Bases: `abc.ABC`

  abstract `add_configuration`(key_type: Union[str, type], value: cpl.configuration.configuration_model_abc.ConfigurationModelABC )

    Add configuration object

    > key_type: Union[`str`, `type`]

    >   Type of the value

    > value: `cpl.configuration.configuration_model_abc.ConfigurationModelABC`

    >   Object of the value

  abstract `add_console_argument`(argument: cpl.configuration.console_argument.ConsoleArgument )

    Adds console argument to known console arguments

    > argument: `cpl.configuration.console_argument.ConsoleArgument`

    >   Specifies the console argument

  abstract `add_console_arguments`(error: Optional[bool] = None)

    Reads the console arguments

    > error: `bool`

    >   Defines is invalid argument error will be shown or not

  abstract `add_environment_variables`(prefix: str)

    Reads the environment variables

    > prefix: `str`

    >   Prefix of the variables

  abstract `add_json_file`(name: str, optional: Optional[bool] = None, output: bool = True, path: Optional[str] = None)

    Reads and saves settings from given json file

    > name: `str`

    >   Name of the file

    > optional: `str`

    >   Specifies whether an error should occur if the file was not found

    > output: `bool`

    >   Specifies whether an output should take place

    > path: `str`

    >   Path in which the file should be stored

  abstract property `additional_arguments`
  abstract property `argument_error_function`
  abstract property `environment`
  abstract `get_configuration`(search_type: Union[str, Type[ cpl.configuration.configuration_model_abc.ConfigurationModelABC ]]) → Union[str, collections.abc.Callable[ cpl.configuration.configuration_model_abc.ConfigurationModelABC ]]

    Returns value from configuration by given type

    > search_type: Union[`str`, Type[`cpl.configuration.configuration_model_abc.ConfigurationModelABC`]]

    >   Type to search for

    > Object of Union[`str`, Callable[`cpl.configuration.configuration_model_abc.ConfigurationModelABC`]]

## cpl.configuration.configuration_model_abc

class `cpl.configuration.configuration_model_abc.``ConfigurationModelABC`

  Bases: `abc.ABC`

  abstract `from_dict`(settings: dict)

    Converts attributes to dict

    > settings: `dict`

## cpl.configuration.configuration_variable_name_enum

class `cpl.configuration.configuration_variable_name_enum.``ConfigurationVariableNameEnum`(value)

  Bases: `enum.Enum`

  An enumeration.

  `customer` = 'CUSTOMER'
  `environment` = 'ENVIRONMENT'
  `name` = 'NAME'
  static `to_list`()

## cpl.configuration.console_argument

class `cpl.configuration.console_argument.``ConsoleArgument`(token: str, name: str, aliases: list, value_token: str, is_value_token_optional: Optional[bool] = None, console_arguments: Optional[list] = None)

  Bases: `object`

  property `aliases`
  property `console_arguments`
  property `is_value_token_optional`
  property `name`
  property `token`
  property `value_token`