THE ORIONIS API
Build with clarity.
Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.
class IStorageDriver(ABC): (source)
Known subclasses: orionis.storage.drivers.AzureStorageDriver, orionis.storage.drivers.GoogleStorageDriver, orionis.storage.drivers.LocalStorageDriver, orionis.storage.drivers.MemoryStorageDriver, orionis.storage.drivers.S3StorageDriver
Define the low-level contract every storage backend must implement.
A driver translates canonical root-relative paths into operations
against a physical medium (local disk, memory, S3, Azure, GCS...).
Drivers contain no business logic; higher-level behavior lives
in orionis.storage.File,
orionis.storage.Directory, and
orionis.storage.Disk. Prefer those interfaces when application
code does not need a backend-specific operation.
| Method | absolute |
Return the absolute filesystem path of the file at path. |
| Async Method | copy |
Copy the file at source to target. |
| Async Method | create |
Create the directory at path, including missing parents. |
| Async Method | delete |
Delete the file at path. |
| Async Method | delete |
Recursively delete the directory at path. |
| Async Method | directories |
List the directory paths contained in the directory at path. |
| Async Method | directory |
Check whether a directory exists at path. |
| Async Method | download |
Copy the file at path to a location on the local filesystem. |
| Async Method | exists |
Check whether a file exists at path. |
| Async Method | files |
List the file paths contained in the directory at path. |
| Async Method | hash |
Compute the content hash of the file at path. |
| Async Method | info |
Collect a metadata snapshot for the file at path. |
| Async Method | last |
Return the last-modification timestamp of the file at path. |
| Async Method | mime |
Guess the MIME type of the file at path. |
| Async Method | move |
Move the file at source to target. |
| Method | open |
Open an asynchronous binary stream for the file at path. |
| Async Method | read |
Read the full contents of the file at path. |
| Method | read |
Stream the contents of the file at path in chunks. |
| Method | relative |
Return the filesystem path relative to the application base path. |
| Async Method | set |
Change the visibility of the file at path. |
| Async Method | size |
Return the size in bytes of the file at path. |
| Async Method | temporary |
Build a signed, time-limited URL for the file at path. |
| Async Method | url |
Build the public URL for the file at path. |
| Async Method | visibility |
Return the visibility of the file at path. |
| Async Method | write |
Write contents to path, replacing any existing file. |
| Async Method | write |
Write the chunks produced by stream to path. |
| Class Variable | __slots__ |
Declare that this class introduces no additional instance slots. |
orionis.storage.drivers.LocalStorageDriverReturn the absolute filesystem path of the file at path.
Drivers with a local filesystem representation may override this operation. The file does not need to exist.
| Parameters | |
path:str | Root-relative file path. |
| Returns | |
str | Absolute path using the operating system's separators. |
| Raises | |
orionis.storage.exceptions.UnsupportedStorageOperationException | If the driver does not expose local filesystem paths. |
orionis.storage.exceptions.StoragePathException | If path is invalid or escapes the disk root. |
orionis.storage.drivers.AzureStorageDriver, orionis.storage.drivers.GoogleStorageDriver, orionis.storage.drivers.LocalStorageDriver, orionis.storage.drivers.MemoryStorageDriver, orionis.storage.drivers.S3StorageDriverCopy the file at source to target.
| Parameters | |
source:str | Root-relative path of the existing file. |
target:str | Root-relative destination path. |
| Returns | |
None | No return value. |
| Raises | |
orionis.storage.exceptions.StorageFileNotFoundException | If the source file does not exist. |
str = '', *, recursive: bool = False) -> list[ str]:
(source)
¶
orionis.storage.drivers.AzureStorageDriver, orionis.storage.drivers.GoogleStorageDriver, orionis.storage.drivers.LocalStorageDriver, orionis.storage.drivers.MemoryStorageDriver, orionis.storage.drivers.S3StorageDriverCopy the file at path to a location on the local filesystem.
| Parameters | |
path:str | Root-relative file path on the disk. |
destination:str | pathlib.Path | Local target. When it points to an existing directory the file keeps its original name inside that directory. |
| Returns | |
pathlib.Path | Absolute local path of the downloaded file. |
| Raises | |
orionis.storage.exceptions.StorageFileNotFoundException | If the file does not exist. |
str = '', *, recursive: bool = False) -> list[ str]:
(source)
¶
orionis.storage.drivers.AzureStorageDriver, orionis.storage.drivers.GoogleStorageDriver, orionis.storage.drivers.LocalStorageDriver, orionis.storage.drivers.MemoryStorageDriver, orionis.storage.drivers.S3StorageDriverCompute the content hash of the file at path.
| Parameters | |
path:str | Root-relative file path. |
algorithm:str | Any algorithm name accepted by hashlib.new. |
| Returns | |
str | Hexadecimal digest of the file contents. |
| Raises | |
orionis.storage.exceptions.StorageFileNotFoundException | If the file does not exist. |
orionis.storage.drivers.AzureStorageDriver, orionis.storage.drivers.GoogleStorageDriver, orionis.storage.drivers.LocalStorageDriver, orionis.storage.drivers.MemoryStorageDriver, orionis.storage.drivers.S3StorageDriverCollect a metadata snapshot for the file at path.
| Parameters | |
path:str | Root-relative file path. |
| Returns | |
orionis.storage.entities.FileInfo | Immutable entity with size, MIME type, timestamps, hashes, visibility, and URL when available. |
| Raises | |
orionis.storage.exceptions.StorageFileNotFoundException | If the file does not exist. |
orionis.storage.drivers.AzureStorageDriver, orionis.storage.drivers.GoogleStorageDriver, orionis.storage.drivers.LocalStorageDriver, orionis.storage.drivers.MemoryStorageDriver, orionis.storage.drivers.S3StorageDriverReturn the last-modification timestamp of the file at path.
| Parameters | |
path:str | Root-relative file path. |
| Returns | |
datetime.datetime | Timezone-aware modification timestamp (UTC). |
| Raises | |
orionis.storage.exceptions.StorageFileNotFoundException | If the file does not exist. |
orionis.storage.drivers.AzureStorageDriver, orionis.storage.drivers.GoogleStorageDriver, orionis.storage.drivers.LocalStorageDriver, orionis.storage.drivers.MemoryStorageDriver, orionis.storage.drivers.S3StorageDriverGuess the MIME type of the file at path.
| Parameters | |
path:str | Root-relative file path. |
| Returns | |
str | None | MIME type, or None when it cannot be determined. |
orionis.storage.drivers.AzureStorageDriver, orionis.storage.drivers.GoogleStorageDriver, orionis.storage.drivers.LocalStorageDriver, orionis.storage.drivers.MemoryStorageDriver, orionis.storage.drivers.S3StorageDriverMove the file at source to target.
| Parameters | |
source:str | Root-relative path of the existing file. |
target:str | Root-relative destination path. |
| Returns | |
None | No return value. |
| Raises | |
orionis.storage.exceptions.StorageFileNotFoundException | If the source file does not exist. |
orionis.storage.drivers.AzureStorageDriver, orionis.storage.drivers.GoogleStorageDriver, orionis.storage.drivers.LocalStorageDriver, orionis.storage.drivers.MemoryStorageDriver, orionis.storage.drivers.S3StorageDriverOpen an asynchronous binary stream for the file at path.
| Parameters | |
path:str | Root-relative file path. |
mode:str | Binary mode: 'rb', 'wb', 'ab', 'rb+', 'wb+', or 'ab+'. |
| Returns | |
orionis.storage.contracts.IStorageStream | Lazily opened stream; use it as an async context manager. |
| Raises | |
orionis.storage.exceptions.UnsupportedStorageOperationException | If mode is not a supported binary mode. |
orionis.storage.drivers.AzureStorageDriver, orionis.storage.drivers.GoogleStorageDriver, orionis.storage.drivers.LocalStorageDriver, orionis.storage.drivers.MemoryStorageDriver, orionis.storage.drivers.S3StorageDriverRead the full contents of the file at path.
| Parameters | |
path:str | Root-relative file path. |
| Returns | |
bytes | Complete file contents. |
| Raises | |
orionis.storage.exceptions.StorageFileNotFoundException | If the file does not exist. |
str, chunk_size: int = 65536) -> AsyncIterator[ bytes]:
(source)
¶
orionis.storage.drivers.AzureStorageDriver, orionis.storage.drivers.GoogleStorageDriver, orionis.storage.drivers.LocalStorageDriver, orionis.storage.drivers.MemoryStorageDriver, orionis.storage.drivers.S3StorageDriverStream the contents of the file at path in chunks.
| Parameters | |
path:str | Root-relative file path. |
chunkint | Maximum number of bytes per yielded chunk. |
| Returns | |
collections.abc.AsyncIterator[bytes] | Asynchronous iterator yielding consecutive chunks. |
| Raises | |
orionis.storage.exceptions.StorageFileNotFoundException | If the file does not exist. |
orionis.storage.drivers.LocalStorageDriverReturn the filesystem path relative to the application base path.
Drivers with a local filesystem representation and an application base path may override this operation. The file need not exist.
| Parameters | |
path:str | Root-relative file path. |
| Returns | |
str | Path from the application base path using / as separator. Roots outside the project may require leading .. segments. |
| Raises | |
orionis.storage.exceptions.UnsupportedStorageOperationException | If local filesystem paths or the application base are unavailable. |
orionis.storage.exceptions.StoragePathException | If path is invalid, escapes the disk root, or cannot be expressed relative to the application base path. |
orionis.storage.drivers.AzureStorageDriver, orionis.storage.drivers.GoogleStorageDriver, orionis.storage.drivers.LocalStorageDriver, orionis.storage.drivers.MemoryStorageDriver, orionis.storage.drivers.S3StorageDriverChange the visibility of the file at path.
| Parameters | |
path:str | Root-relative file path. |
visibility:str | Target visibility ('public' or 'private'). |
| Returns | |
None | No return value. |
| Raises | |
orionis.storage.exceptions.StorageFileNotFoundException | If the file does not exist. |
orionis.storage.exceptions.UnsupportedStorageOperationException | If visibility is not a supported level. |
orionis.storage.drivers.AzureStorageDriver, orionis.storage.drivers.GoogleStorageDriver, orionis.storage.drivers.LocalStorageDriver, orionis.storage.drivers.MemoryStorageDriver, orionis.storage.drivers.S3StorageDriverReturn the size in bytes of the file at path.
| Parameters | |
path:str | Root-relative file path. |
| Returns | |
int | File size in bytes. |
| Raises | |
orionis.storage.exceptions.StorageFileNotFoundException | If the file does not exist. |
orionis.storage.drivers.AzureStorageDriver, orionis.storage.drivers.GoogleStorageDriver, orionis.storage.drivers.LocalStorageDriver, orionis.storage.drivers.MemoryStorageDriver, orionis.storage.drivers.S3StorageDriverBuild a signed, time-limited URL for the file at path.
| Parameters | |
path:str | Root-relative file path. |
expiresint | Lifetime of the URL in seconds. |
| Returns | |
str | Temporary URL valid for expires_in seconds. |
| Raises | |
orionis.storage.exceptions.UnsupportedStorageOperationException | If the driver does not support temporary URLs. |
orionis.storage.drivers.AzureStorageDriver, orionis.storage.drivers.GoogleStorageDriver, orionis.storage.drivers.LocalStorageDriver, orionis.storage.drivers.MemoryStorageDriver, orionis.storage.drivers.S3StorageDriverBuild the public URL for the file at path.
| Parameters | |
path:str | Root-relative file path. |
| Returns | |
str | Publicly accessible URL for the file. |
| Raises | |
orionis.storage.exceptions.UnsupportedStorageOperationException | If the disk does not expose public URLs. |
orionis.storage.drivers.AzureStorageDriver, orionis.storage.drivers.GoogleStorageDriver, orionis.storage.drivers.LocalStorageDriver, orionis.storage.drivers.MemoryStorageDriver, orionis.storage.drivers.S3StorageDriverReturn the visibility of the file at path.
| Parameters | |
path:str | Root-relative file path. |
| Returns | |
str | 'public' or 'private'. |
| Raises | |
orionis.storage.exceptions.StorageFileNotFoundException | If the file does not exist. |
str, contents: bytes | str, visibility: str | None = None):
(source)
¶
str, stream: AsyncIterable[ bytes], visibility: str | None = None):
(source)
¶
orionis.storage.drivers.AzureStorageDriver, orionis.storage.drivers.GoogleStorageDriver, orionis.storage.drivers.LocalStorageDriver, orionis.storage.drivers.MemoryStorageDriver, orionis.storage.drivers.S3StorageDriverWrite the chunks produced by stream to path.
| Parameters | |
path:str | Root-relative file path. |
stream:collections.abc.AsyncIterable[bytes] | Asynchronous byte-chunk producer. |
visibility:str | None | Visibility to apply, or None for the medium default. |
| Returns | |
None | No return value. |
orionis.storage.drivers.AzureStorageDriver, orionis.storage.drivers.GoogleStorageDriver, orionis.storage.drivers.LocalStorageDriver, orionis.storage.drivers.MemoryStorageDriver, orionis.storage.drivers.S3StorageDriverDeclare that this class introduces no additional instance slots.