ducpy.serialize.serialize_binary_files¶
Functions¶
|
Creates a dictionary representing the data for a single binary file. |
|
Creates the main binary_files dictionary from a list of file data dictionaries. |
|
Safely get an attribute from an object or dictionary. |
|
Module Contents¶
- ducpy.serialize.serialize_binary_files.create_binary_file_data_dict(mime_type: str, image_id: str, image_bytes: bytes, timestamp_ms: int) Dict[str, ducpy.classes.BinaryFilesClass.BinaryFiles] ¶
Creates a dictionary representing the data for a single binary file. This dictionary is suitable for use as a value in the main binary_files dictionary passed to serialize_binary_files.
- ducpy.serialize.serialize_binary_files.create_binary_files_dict_from_list(files_data: List[Dict[str, ducpy.classes.BinaryFilesClass.BinaryFiles]]) Dict[str, Dict[str, ducpy.classes.BinaryFilesClass.BinaryFiles]] ¶
Creates the main binary_files dictionary from a list of file data dictionaries. Each item in the list should be a dictionary with keys: ‘image_id’, ‘mime_type’, ‘image_bytes’, ‘timestamp_ms’. The ‘image_id’ will be used as the key in the output dictionary and for the ‘id’ field.
- ducpy.serialize.serialize_binary_files.get_attribute(obj: Dict | Any, attr: str, alt_attr: str = None)¶
Safely get an attribute from an object or dictionary.
- ducpy.serialize.serialize_binary_files.serialize_binary_files(builder: flatbuffers.Builder, binary_files: Dict[str, Dict | ducpy.classes.BinaryFilesClass.BinaryFiles]) int ¶