m3resp.event_to_dict#

m3resp.event_to_dict(value)[source]#

Return the fields of an event, interval or breath as a dictionary.

Parameters:

value (Event | Interval | Mapping[str, Any] | Any) – An Event, Interval or BreathEvent, another dataclass instance, a dictionary, or an iterable of key-value pairs.

Returns:

All fields, including timing, identifier and metadata.

Dataclass fields are copied recursively; dictionary inputs are copied at the top level. Field values keep their existing types.

Return type:

dict[str, Any]

Raises:
  • TypeError – If the input cannot be read as a dictionary.

  • ValueError – If a key-value pair has an invalid length.