pyrit.models.StorageIO#

class StorageIO[source]#

Bases: ABC

Abstract interface for storage systems (local disk, Azure Storage Account, etc.).

__init__()#

Methods

__init__()

create_directory_if_not_exists(path)

Asynchronously creates a directory or equivalent in the storage system if it doesn't exist.

is_file(path)

Asynchronously checks if the path refers to a file (not a directory or container).

path_exists(path)

Asynchronously checks if a file or blob exists at the given path.

read_file(path)

Asynchronously reads the file (or blob) from the given path.

write_file(path, data)

Asynchronously writes data to the given path.

abstract async create_directory_if_not_exists(path: Path | str) None[source]#

Asynchronously creates a directory or equivalent in the storage system if it doesn’t exist.

abstract async is_file(path: Path | str) bool[source]#

Asynchronously checks if the path refers to a file (not a directory or container).

abstract async path_exists(path: Path | str) bool[source]#

Asynchronously checks if a file or blob exists at the given path.

abstract async read_file(path: Path | str) bytes[source]#

Asynchronously reads the file (or blob) from the given path.

abstract async write_file(path: Path | str, data: bytes) None[source]#

Asynchronously writes data to the given path.