pmotools.pmo_engine.pmo_writer module

class pmotools.pmo_engine.pmo_writer.PMOWriter[source]

Bases: object

A class for writing a PMO to file

static add_pmo_extension_as_needed(output_fnp, gzip: bool = True)[source]

Add on json or json.gz as needed to output pmo file

Parameters:
  • output_fnp – the original output filename path

  • gzip – whether to gzip the output file

Returns:

the output filename path with the extension added if needed

static write_out_pmo(pmo, fnp: str | PathLike[str], overwrite: bool = False)[source]

Write out a PMO, will write to zip file if the output fnp name ends with .gz

Parameters:
  • pmo – the PMO to write

  • fnp – the output filename path

  • overwrite – whether to overwrite output file if it exists

Returns:

nothing