pyrit.models.DataTypeSerializer#
- class DataTypeSerializer[source]#
Bases:
ABC
Abstract base class for data type normalizers.
This class is responsible for saving multi-modal types to disk.
- __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.
is_url
(path)Helper function to check if a given path is a URL.
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.