ORIONIS API REFERENCE

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 documentation

class IDisk(ABC): (source)

Known subclasses: orionis.storage.Disk

View In Hierarchy

Define the contract for a configured storage disk.

A disk is the entry point to a storage backend. It builds ~orionis.storage.contracts.file.IFile and ~orionis.storage.contracts.directory.IDirectory objects bound to its driver and offers a small set of convenience methods that always delegate to those objects.

Async Method copy Copy the file at source to target on this disk.
Async Method delete Delete the file at path from this disk.
Method directory Build a directory object for path on this disk.
Async Method exists Check whether a file exists at path on this disk.
Method file Build a file object for path on this disk.
Async Method move Move the file at source to target on this disk.
Method name Return the configuration name of the disk.
Async Method put Write contents to path on this disk.
Class Variable __slots__ Undocumented
@abstractmethod
async def copy(self, source: str, target: str) -> IFile: (source)
overridden in orionis.storage.Disk

Copy the file at source to target on this disk.

Parameters
source:strRoot-relative path of the existing file.
target:strRoot-relative destination path.
Returns
IFileFile object pointing at the copy.
Raises
StorageFileNotFoundExceptionIf the source file does not exist.
@abstractmethod
async def delete(self, path: str) -> bool: (source)
overridden in orionis.storage.Disk

Delete the file at path from this disk.

Parameters
path:strRoot-relative file path.
Returns
boolTrue if the file existed and was removed.
@abstractmethod
def directory(self, path: str = '') -> IDirectory: (source)
overridden in orionis.storage.Disk

Build a directory object for path on this disk.

Parameters
path:strRoot-relative directory path. The empty string denotes the disk root.
Returns
IDirectoryDirectory object bound to this disk's driver.
@abstractmethod
async def exists(self, path: str) -> bool: (source)
overridden in orionis.storage.Disk

Check whether a file exists at path on this disk.

Parameters
path:strRoot-relative file path.
Returns
boolTrue if a file exists at the given path.
@abstractmethod
def file(self, path: str) -> IFile: (source)
overridden in orionis.storage.Disk

Build a file object for path on this disk.

Parameters
path:strRoot-relative file path.
Returns
IFileFile object bound to this disk's driver.
@abstractmethod
async def move(self, source: str, target: str) -> IFile: (source)
overridden in orionis.storage.Disk

Move the file at source to target on this disk.

Parameters
source:strRoot-relative path of the existing file.
target:strRoot-relative destination path.
Returns
IFileFile object pointing at the moved file.
Raises
StorageFileNotFoundExceptionIf the source file does not exist.
@abstractmethod
def name(self) -> str: (source)
overridden in orionis.storage.Disk

Return the configuration name of the disk.

Returns
strDisk name as declared in the filesystems configuration.
@abstractmethod
async def put(self, path: str, contents: bytes | str, visibility: str | None = None) -> IFile: (source)
overridden in orionis.storage.Disk

Write contents to path on this disk.

Parameters
path:strRoot-relative file path.
contents:bytes | strData to persist. Strings are encoded as UTF-8.
visibility:str | NoneVisibility to apply, or None for the medium default.
Returns
IFileFile object pointing at the written file.
__slots__: tuple = (source)
overridden in orionis.storage.Disk

Undocumented