openJson#

pyCGM2.Utils.files.openJson(path: str, filename: str)#

Open a JSON file and return its contents as a dictionary.

Parameters:
  • path (str) – The directory path where the file is located.

  • filename (str) – The JSON filename.

Returns:

dict – The contents of the JSON file.

Raises:

Exception – If there is a JSON syntax error.