Configuration

keyval_check

Check and clean up key,value pairs while parsing a config file.

validate_options

Validate a configuration option against a set of allowed options.

validate_value

Validate the value of a configuration option.

version_dict

Get the versions of used packages

cesard.config.keyval_check(key, val, allowed_keys)[source]

Check and clean up key,value pairs while parsing a config file.

Parameters:
  • key (str) – the parameter key

  • val (str) – the parameter value

  • allowed_keys (list[str]) – a list of allowed keys

Return type:

str | None

cesard.config.validate_options(k, v, options)[source]

Validate a configuration option against a set of allowed options.

Parameters:
  • k (str) – the configuration key

  • v (str) – the configuration value

  • options (dict[str, list[str]]) – the configuration options

Return type:

None

cesard.config.validate_value(k, v)[source]

Validate the value of a configuration option.

Parameters:
  • k (str) – the configuration key

  • v (str | None | list[str]) – the configuration value

Return type:

None

cesard.config.version_dict()[source]

Get the versions of used packages

Return type:

dict[str, str]

Returns:

a dictionary containing the versions of relevant python packages. Keys:

  • python

  • gdal

  • spatialist

  • pyrosar

  • cesard