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

Coordinate disk resolution for the storage component.

The manager reads the filesystems configuration, builds orionis.storage.Disk objects bound to their drivers, and caches them per name. It knows nothing about files or directories: that behavior lives in the domain objects returned by each disk.

Method __buildDriver Instantiate the driver for the disk named name.
Method __buildLocalDriver Build a local driver from a disk configuration entity.
Method __diskConfig Return the configuration entity for the disk named name.
Method __init__ Initialize the manager and resolve the active configuration.
Method default Resolve the default disk from the configuration.
Method disk Resolve the disk registered under name.
Method extend Register a custom driver factory under driver.
Method uploaded Wrap an HTTP multipart payload as a storable uploaded file.
Class Variable __slots__ Declare the instance attribute slots reserved by this class.
Instance Variable _app Application container used to read the configuration and the base path.
Instance Variable _base_path Base path obtained from app.basePath.
Instance Variable _config Validated configuration used to construct and operate the service.
Instance Variable _custom Custom implementations registered by the application.
Instance Variable _default Value used when the client omits this argument.
Instance Variable _disks Storage disks cached after their first resolution.
Instance Variable _lock Serialize disk publication while allowing nested synchronous factories.
def __buildDriver(self, name: str) -> IStorageDriver: (source)

Instantiate the driver for the disk named name.

Parameters
name:strDisk name as declared in the filesystems configuration.
Returns
orionis.storage.contracts.IStorageDriverConfigured driver instance.
Raises
orionis.storage.exceptions.DiskNotFoundExceptionIf the disk is not declared in the configuration.
orionis.storage.exceptions.DriverNotSupportedExceptionIf the disk references a driver with no implementation.
def __buildLocalDriver(self, config: object) -> IStorageDriver: (source)

Build a local driver from a disk configuration entity.

Parameters
config:objectDisk configuration entity exposing path and, optionally, url.
Returns
orionis.storage.contracts.IStorageDriverLocal driver rooted inside the application base path.
def __diskConfig(self, name: str) -> object: (source)

Return the configuration entity for the disk named name.

Parameters
name:strDisk name as declared in the filesystems configuration.
Returns
objectDisk configuration entity.
Raises
orionis.storage.exceptions.DiskNotFoundExceptionIf the disk is not declared in the configuration.
def __init__(self, app: IApplication): (source)

Initialize the manager and resolve the active configuration.

Parameters
app:orionis.IApplicationApplication container used to read the configuration and the base path.
Returns
NoneNo return value.
def default(self) -> IDisk: (source)

Resolve the default disk from the configuration.

Returns
orionis.storage.contracts.IDiskThe disk configured as default.
Raises
orionis.storage.exceptions.DiskNotFoundExceptionIf the default disk is not declared in the configuration.
def disk(self, name: str | None = None) -> IDisk: (source)

Resolve the disk registered under name.

Build and publish a single disk on first access, including concurrent calls. A synchronous custom factory may resolve another configured disk. Subsequent calls reuse the published instance without taking the lock.

Parameters
name:str | NoneDisk name as declared in the filesystems configuration, or None for the default disk.
Returns
orionis.storage.contracts.IDiskDisk bound to its configured driver.
Raises
orionis.storage.exceptions.DiskNotFoundExceptionIf the disk is not declared in the configuration.
orionis.storage.exceptions.DriverNotSupportedExceptionIf the disk references a driver with no implementation.
def extend(self, driver: str, factory: Callable[[object], IStorageDriver]): (source)

Register a custom driver factory under driver.

The factory receives the disk configuration entity and must return a ready-to-use driver instance. Registering a factory clears the disk cache so new resolutions pick it up.

Parameters
driver:strDriver name as referenced by disk configurations.
factory:typing.Callable[[object], contracts.IStorageDriver]Callable building the driver from a disk configuration.
Returns
NoneNo return value.
def uploaded(self, source: IHttpUploadedFile) -> IUploadedFile: (source)

Wrap an HTTP multipart payload as a storable uploaded file.

Parameters
source:orionis.http.payload.contracts.uploaded_file.IUploadedFileBuffered multipart payload produced by the HTTP layer.
Returns
orionis.storage.contracts.IUploadedFileUploaded file bound to this manager for disk resolution.
__slots__: tuple[str, ...] = (source)

Declare the instance attribute slots reserved by this class.

Application container used to read the configuration and the base path.

_base_path: Path = (source)

Base path obtained from app.basePath.

_config: Filesystems = (source)

Validated configuration used to construct and operate the service.

_custom: dict[str, Callable[[object], IStorageDriver]] = (source)

Custom implementations registered by the application.

_default: str = (source)

Value used when the client omits this argument.

_disks: dict[str, IDisk] = (source)

Storage disks cached after their first resolution.

Serialize disk publication while allowing nested synchronous factories.