ctdam.parser.xmlfiles module

class ctdam.parser.xmlfiles.XMLFile(path_to_file)[source]

Bases: UserDict

Parent class for XML and psa representation that loads XML as a python-internal tree and as a dict.

Parameters:

path_to_file (Path | str) – The path to the xml file

to_xml(file_name=None, file_path=None)[source]

Writes the dictionary to xml.

Parameters:
  • file_name (str) – the original files name (Default value = self.file_name)

  • file_path (pathlib.Path) – the directory of the file (Default value = self.file_dir)

to_json(file_name=None, file_path=None)[source]

Writes the dictionary representation of the XML input to a json file.

Parameters:
  • file_name (str) – the original files name (Default value = self.file_name)

  • file_path (pathlib.Path) – the directory of the file (Default value = self.file_dir)

class ctdam.parser.xmlfiles.XMLCONFile(path_to_file)[source]

Bases: XMLFile

get_sensor_info()[source]

Creates a multilevel dictionary, dropping the first four dictionaries, to retrieve pure sensor information.

Return type:

list[dict]

class ctdam.parser.xmlfiles.PsaFile(path_to_file)[source]

Bases: XMLFile

A representation of a .psa file.