Classes
OsPath
Represents a filesystem path with type and overwrite options.
Attributes:
path (str): The filesystem path.
type (Literal[“file”, “directory”, “outputfile”]): The type of path, defaults to “file”.
overwrite (bool): Whether to overwrite an existing file, defaults to False.
Methods
read_file
string (for text) or bytes (for PDF), or None if not readable.
write_file
content (bytes): The content to write.
Raises:
FileExistsError: If the file exists and overwrite is False.