IO Module

Defines read and write files functions

Configuration

Defines methods to save and load Configuration objects to a json file

Note

It is possible to save and load .jsonc files and use // characters to comment the file.

The comments are discarded when the file is loaded: there are only here to increase the json readability.

write_json(file_path: str, config: Configuration) None

Write the Configuration object to a json file

Parameters:
  • file_path (str) – the path of the file to read

  • config (Configuration) – the configuration to write

read_json(file_path: str) Any

Read a Configuration from a json file

Parameters:

file_path (str) – the path of the file to read

Returns:

the loaded configuration

Return type:

Configuration

Aliases

Defines methods to load aliases folders.

load_aliases(path: str) None

Load all aliases recursively in the directory into the Alias Register.

Warning

The given key for each alias is its file name without extensions. It has to be unique.

Parameters:

path (Path) – the alias directory path to load.