labscheduler.utilities module

A collection of useful functions to use the labscheduler.

labscheduler.utilities.add_timedelta_to_datetimes(data: list | dict | str, delta: timedelta)[source]

Recursively traverse the JSON structure and add a given timedelta to any string that is a valid datetime in ISO format.

Parameters:
  • data – The JSON-loaded data (can be list, dict, or other types)

  • delta – A datetime.timedelta object to add to found datetimes

Returns:

Updated data with all datetime strings incremented by delta.

labscheduler.utilities.create_operations_from_json(workflow_graph)[source]
labscheduler.utilities.extract_timestamp(filename: str) datetime | None[source]