Skip to main content
Persistent configuration.

Config

Parameters
Path | None
Bases: object Config management. A class to work with configuration such as reading, writing and deleting.

exists()

Returns: bool Check if any configuration exist.

read()

Returns: ValidioConfig Read persistent configuration. Will return None if no configuration is created yet.
  • Returns: The configuration, or None
  • Return type: ValidioConfig | None
  • Raises: ConfigNotFoundError if no configuration exists
  • Raises: ConfigNotFoundError if the configuration is invalid

remove()

Returns: None Remove the configuration at the instance’s config_path.

write()

Parameters
Returns: None Write the passed configuration to disk. This will fully overwrite the existing configuration, including any fields that’s not a part of the ValidioConfig.
  • Parameters: config – A ValidioConfig object.

ValidioConfig

Parameters
str
str
str
str
Bases: object Representation of configuration to use in the Validio system and SDK.

access_secret

asdict()

Returns: dict[str, str] Return a dictionary representation of the class. This is used from our ClassJSONEncoder to ensure we save JSON representing the class with the external property names. By doing this we can also ensure that we can serialize the config by passing the JSON to the constructor.

default_config_dir()

Returns: Path Get the default config dir based on the OS.