export_json#

rojak.orchestrator.lite_controller.export_json(obj_to_dump, output_dir, start_time, type_adpater, fname_identifier, /, *, indent=4)[source]#

Serialise obj_to_dump to a timestamped JSON file under output_dir

Parameters:
  • obj_to_dump (T) – Object to serialise. Must match the type type_adpater was built for.

  • output_dir (Path) – Directory to write the JSON file into, created (along with any missing parents) if needed

  • start_time (str) – Timestamp identifying this run, included in the output filename

  • type_adpater (TypeAdapter) – Pydantic TypeAdapter used to serialise obj_to_dump

  • fname_identifier (str) – Prefix for the output filename, which is f"{fname_identifier}_{start_time}.json"

  • indent (int) – Indentation (in spaces) for the written JSON. Defaults to 4.

Return type:

None