pyrit.models.DataTypeSerializer#
- class DataTypeSerializer[source]#
Bases:
ABC
Abstract base class for data type normalizers.
Responsible for reading and saving multi-modal data types to local disk or Azure Storage Account.
- __init__()#
Methods
__init__
()Returns True if the data is stored on disk.
Generates or retrieves a unique filename for the data file.
get_extension
(file_path)Get the file extension from the file path.
get_mime_type
(file_path)Get the MIME type of the file path.
Reads the data from the storage.
Reads the data from the storage.
save_b64_image
(data[, output_filename])Saves the base64 encoded image to storage.
save_data
(data)Saves the data to storage.
Attributes
- async get_data_filename() Path | str [source]#
Generates or retrieves a unique filename for the data file.
- static get_extension(file_path: str) str | None [source]#
Get the file extension from the file path.
- async read_data() bytes [source]#
Reads the data from the storage.
- Returns:
The data read from storage.
- Return type: