mac_maker.utilities.mixins.json_file

JSONFile mixin classes.

class mac_maker.utilities.mixins.json_file.JSONFileReader[source]

JSONFileReader mixin class.

load_json_file(json_file_location)[source]

Load a JSON file from the filesystem and return it as a Python object.

Parameters:

json_file_location (Union[Path, str]) – The path to the source file.

Return type:

Any

Returns:

The loaded JSON object.

class mac_maker.utilities.mixins.json_file.JSONFileWriter[source]

JSONFileWriter mixin class.

write_json_file(python_object, json_file_location)[source]

Write a Python object to the filesystem as JSON.

Parameters:
  • python_object (Any) – The Python object to write to file as JSON.

  • json_file_location (Union[Path, str]) – The path to the destination file.

Return type:

None