juturna.payloads package

Module contents

class juturna.payloads.AudioPayload(audio: numpy.ndarray = <factory>, sampling_rate: int = -1, audio_format: str = '', channels: int = -1, start: float = -1.0, end: float = -1.0)

Bases: BasePayload

audio: ndarray
audio_format: str = ''
channels: int = -1
end: float = -1.0
sampling_rate: int = -1
static serialize(obj) dict
start: float = -1.0
class juturna.payloads.Batch(messages: tuple = <factory>)

Bases: BasePayload

messages: tuple
static serialize(obj) list
class juturna.payloads.BytesPayload(cnt: bytes = <factory>)

Bases: BasePayload

cnt: bytes
static serialize(obj) dict
class juturna.payloads.Draft(payload_type: T, copy_from: T | None = None)

Bases: Generic

Payloads can be built using drafts. A draft stores the payload values, and once it is compiled an actual payload will be generated.

clear()

Clear all stored keys and values

compile() T

Compile the payload, using all the stored key-value items.

Returns:

A new payload.

Return type:

BasePayload

Raises:

TypeError – If the draft was not open, so the payload type was not set, the method raises a TypeError.

class juturna.payloads.ImagePayload(image: numpy.ndarray = <factory>, width: int = -1, height: int = -1, depth: int = -1, pixel_format: str = '', timestamp: float = -1.0)

Bases: BasePayload

depth: int = -1
height: int = -1
image: ndarray
pixel_format: str = ''
static serialize(obj) dict
timestamp: float = -1.0
width: int = -1
class juturna.payloads.ObjectPayload(**kwargs)

Bases: dict, BasePayload

static from_dict(origin: dict)
class juturna.payloads.VideoPayload(video: list[juturna.payloads._payloads.ImagePayload] = <factory>, frames_per_second: float = -1.0, start: float = -1.0, end: float = -1.0)

Bases: BasePayload

end: float = -1.0
frames_per_second: float = -1.0
static serialize(obj) dict
start: float = -1.0
video: list[ImagePayload]