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 AzureStorageDriver(IStorageDriver): (source)
Constructor: AzureStorageDriver(config)
Storage driver backed by Azure Blob Storage.
Uses the official Azure SDK for Python (azure-storage-blob), which is an optional dependency: it is not installed with the framework. Install it before using this driver:
uv add 'orionis[azure]'
The SDK is imported lazily on first operation, and every blocking
call runs on a worker thread via asyncio.to_thread.
Directories are virtual: prefixes are inferred from blob names and
explicit directories are stored as zero-byte path/ markers.
Azure has no per-blob visibility: visibility reflects the
container access level and setVisibility is unsupported.
| Method | __blob |
Return the blob client for normalized. |
| Method | __container |
Return the container client, bootstrapping it on first use. |
| Method | __content |
Build the content settings for an upload, when derivable. |
| Method | __init__ |
Initialize the driver from an Azure disk configuration entity. |
| Method | __list |
List every blob name under prefix. |
| Method | __missing |
Build the framework exception for a missing blob. |
| Method | __props |
Fetch blob properties or raise when the blob is absent. |
| Async Method | __spool |
Buffer an async byte stream into a spooled temporary file. |
| Method | __url |
Compose the public URL of a blob without SDK involvement. |
| Async Method | copy |
Copy the blob at source to target. |
| Async Method | create |
Create a zero-byte directory marker at path. |
| Async Method | delete |
Delete the blob at path. |
| Async Method | delete |
Recursively delete every blob under path. |
| Async Method | directories |
List the directory prefixes contained under path. |
| Async Method | directory |
Check whether any blob exists under path. |
| Async Method | download |
Download the blob at path to the local filesystem. |
| Async Method | exists |
Check whether a blob exists at path. |
| Async Method | files |
List the blob names that represent files under path. |
| Async Method | hash |
Compute the content hash of the blob at path. |
| Async Method | info |
Collect a metadata snapshot for the blob at path. |
| Async Method | last |
Return the last-modification timestamp of the blob at path. |
| Async Method | mime |
Return the MIME type of the blob at path. |
| Async Method | move |
Move the blob at source to target. |
| Method | open |
Open an asynchronous binary stream for the blob at path. |
| Async Method | read |
Read the full contents of the blob at path. |
| Async Method | read |
Stream the contents of the blob at path in chunks. |
| Async Method | set |
Change the visibility of the blob at path. |
| Async Method | size |
Return the size in bytes of the blob at path. |
| Async Method | temporary |
Build a SAS URL for the blob at path. |
| Async Method | url |
Build the public URL for the blob at path. |
| Async Method | visibility |
Return the effective visibility of the blob at path. |
| Async Method | write |
Write contents to path, replacing any existing blob. |
| Async Method | write |
Write the chunks produced by stream to path. |
| Class Variable | __slots__ |
Undocumented |
| Instance Variable | _account |
Undocumented |
| Instance Variable | _account |
Undocumented |
| Instance Variable | _base |
Undocumented |
| Instance Variable | _connection |
Undocumented |
| Instance Variable | _container |
Undocumented |
| Instance Variable | _container |
Undocumented |
| Instance Variable | _http |
Undocumented |
| Instance Variable | _not |
Undocumented |
| Instance Variable | _sdk |
Undocumented |
Return the blob client for normalized.
| Parameters | |
normalized:str | Canonical root-relative file path. |
| Returns | |
Any | BlobClient bound to the blob. |
Return the container client, bootstrapping it on first use.
| Returns | |
Any | Configured ContainerClient instance. |
| Raises | |
MissingStorageDependencyException | If azure-storage-blob is not installed. |
Build the content settings for an upload, when derivable.
| Parameters | |
normalized:str | Canonical root-relative file path. |
| Returns | |
Any | ContentSettings with the guessed MIME type, or None when no type could be guessed. |
Initialize the driver from an Azure disk configuration entity.
No SDK import or network activity happens here; the client is bootstrapped lazily on first use. When a connection string is provided, the account name and key are parsed from it so URLs and SAS tokens can be produced.
| Parameters | |
config:object | Disk configuration exposing connection_string, account_name, account_key, container, and url. |
| Returns | |
None | Undocumented |
Build the framework exception for a missing blob.
| Parameters | |
normalized:str | Canonical root-relative file path. |
| Returns | |
StorageFileNotFoundException | Exception instance ready to be raised. |
Fetch blob properties or raise when the blob is absent.
| Parameters | |
normalized:str | Canonical root-relative file path. |
| Returns | |
Any | BlobProperties for the blob. |
| Raises | |
StorageFileNotFoundException | If the blob does not exist. |
Buffer an async byte stream into a spooled temporary file.
| Parameters | |
stream:AsyncIterable[bytes] | Asynchronous byte-chunk producer. |
| Returns | |
BinaryIO | Rewound buffer holding the full payload. |
Copy the blob at source to target.
The content is streamed through a spooled local buffer, which works with any authentication mode and never loads large blobs fully into memory.
| Parameters | |
source:str | Root-relative path of the existing blob. |
target:str | Root-relative destination path. |
| Returns | |
None | Undocumented |
| Raises | |
StorageFileNotFoundException | If the source blob does not exist. |
Download the blob at path to the local filesystem.
| Parameters | |
path:str | Root-relative file path on the disk. |
destination:str | Path | Local target. When it points to an existing directory the file keeps its original name inside that directory. |
| Returns | |
Path | Absolute local path of the downloaded file. |
| Raises | |
StorageFileNotFoundException | If the blob does not exist. |
Compute the content hash of the blob at path.
The blob is streamed in chunks, so large files never load fully into memory.
| Parameters | |
path:str | Root-relative file path. |
algorithm:str | Any algorithm name accepted by hashlib.new. |
| Returns | |
str | Hexadecimal digest of the blob contents. |
| Raises | |
StorageFileNotFoundException | If the blob does not exist. |
UnsupportedStorageOperationException | If algorithm is not available. |
Collect a metadata snapshot for the blob at path.
The snapshot is built from blob properties only; checksum holds the Content-MD5 stored by Azure when available.
| Parameters | |
path:str | Root-relative file path. |
| Returns | |
FileInfo | Immutable entity with size, MIME type, timestamps, ETag, visibility, and URL. |
| Raises | |
StorageFileNotFoundException | If the blob does not exist. |
Return the MIME type of the blob at path.
Prefers the content type stored in Azure and falls back to a guess based on the file extension.
| Parameters | |
path:str | Root-relative file path. |
| Returns | |
str | None | MIME type, or None when it cannot be determined. |
| Raises | |
StorageFileNotFoundException | If the blob does not exist. |
Open an asynchronous binary stream for the blob at path.
Read-oriented modes download the blob into a spooled temporary buffer; writable modes upload the buffered content back to Azure when the stream is closed.
| Parameters | |
path:str | Root-relative file path. |
mode:str | Binary mode: 'rb', 'wb', 'ab', 'rb+', 'wb+', or 'ab+'. |
| Returns | |
AsyncStream | Lazily opened stream; use it as an async context manager. |
| Raises | |
UnsupportedStorageOperationException | If mode is not a supported binary mode. |
str, chunk_size: int = _CHUNK_SIZE) -> AsyncIterator[ bytes]:
(source)
¶
Stream the contents of the blob at path in chunks.
Chunk sizing follows the SDK transfer configuration; the chunk_size parameter is advisory for this driver.
| Parameters | |
path:str | Root-relative file path. |
chunkint | Advisory chunk size in bytes. |
| Returns | |
AsyncIterator[ | Undocumented |
| Yields | |
bytes | Consecutive chunks of the blob contents. |
| Raises | |
StorageFileNotFoundException | If the blob does not exist. |
Change the visibility of the blob at path.
Azure Blob Storage does not support per-blob visibility, so this operation always fails. Adjust the container access level from the Azure portal or management SDK instead.
| Parameters | |
path:str | Root-relative file path. |
visibility:str | Requested visibility level. |
| Returns | |
None | Never returned by this driver. |
| Raises | |
UnsupportedStorageOperationException | Always, since Azure has no per-blob visibility. |
Build a SAS URL for the blob at path.
Requires the storage account key, either configured explicitly or embedded in the connection string.
| Parameters | |
path:str | Root-relative file path. |
expiresint | Lifetime of the URL in seconds. |
| Returns | |
str | Read-only SAS URL valid for expires_in seconds. |
| Raises | |
UnsupportedStorageOperationException | If no account key is available for signing. |
MissingStorageDependencyException | If azure-storage-blob is not installed. |
Return the effective visibility of the blob at path.
Azure controls access at container level, so the result reflects the container access policy rather than a per-blob ACL.
| Parameters | |
path:str | Root-relative file path. |
| Returns | |
str | 'public' when the container allows anonymous access, otherwise 'private'. |
| Raises | |
StorageFileNotFoundException | If the blob does not exist. |
Write contents to path, replacing any existing blob.
Azure Blob Storage has no per-blob visibility; access is governed by the container access level, so visibility is accepted for interface compatibility but ignored.
| Parameters | |
path:str | Root-relative file path. |
contents:bytes | str | Data to persist. Strings are encoded as UTF-8. |
visibility:str | None | Ignored by this driver. |
| Returns | |
None | Undocumented |
str, stream: AsyncIterable[ bytes], visibility: str | None = None):
(source)
¶
Write the chunks produced by stream to path.
The payload is buffered into a spooled temporary file (spilling to disk past 8 MiB) and uploaded in blocks by the SDK.
| Parameters | |
path:str | Root-relative file path. |
stream:AsyncIterable[bytes] | Asynchronous byte-chunk producer. |
visibility:str | None | Ignored by this driver. |
| Returns | |
None | Undocumented |