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 IUploadedFile(ABC): (source)

Known subclasses: orionis.storage.UploadedFile

View In Hierarchy

Define the contract for a file received through HTTP.

An uploaded file adapts an incoming multipart payload so it can be persisted onto any configured disk. It is fully decoupled from the HTTP request object: it only consumes the buffered payload handle.

Async Method copy Persist the payload while keeping the upload buffer usable.
Method extension Return the lowercase file extension including the dot.
Method hashName Return a random, collision-safe name for the file.
Method mimeType Return the MIME type declared by the client.
Async Method move Persist the payload and release the upload buffer.
Method originalName Return the sanitized client-supplied file name.
Async Method read Read the full uploaded payload.
Method size Return the size of the uploaded payload in bytes.
Async Method store Persist the payload under a generated hash name.
Async Method storeAs Persist the payload under an explicit file name.
Class Variable __slots__ Undocumented
@abstractmethod
async def copy(self, directory: str, name: str | None = None, disk: str | None = None) -> IFile: (source)

Persist the payload while keeping the upload buffer usable.

Parameters
directory:strRoot-relative target directory on the disk.
name:str | NoneTarget file name, or None to use a generated hash name.
disk:str | NoneDisk name, or None for the default disk.
Returns
IFileFile object pointing at the stored file.
@abstractmethod
def extension(self) -> str: (source)

Return the lowercase file extension including the dot.

Returns
strExtension such as '.png', or an empty string when the original name has none.
@abstractmethod
def hashName(self) -> str: (source)

Return a random, collision-safe name for the file.

The name is generated once and cached, so repeated calls on the same instance always return the same value.

Returns
strRandom hexadecimal name with the original extension.
@abstractmethod
def mimeType(self) -> str | None: (source)

Return the MIME type declared by the client.

Returns
str | NoneDeclared MIME type, or None when absent.
@abstractmethod
async def move(self, directory: str, name: str | None = None, disk: str | None = None) -> IFile: (source)

Persist the payload and release the upload buffer.

Parameters
directory:strRoot-relative target directory on the disk.
name:str | NoneTarget file name, or None to use a generated hash name.
disk:str | NoneDisk name, or None for the default disk.
Returns
IFileFile object pointing at the stored file.
@abstractmethod
def originalName(self) -> str: (source)

Return the sanitized client-supplied file name.

Returns
strOriginal file name as reported by the client.
@abstractmethod
async def read(self) -> bytes: (source)

Read the full uploaded payload.

Returns
bytesComplete payload contents.
@abstractmethod
def size(self) -> int: (source)

Return the size of the uploaded payload in bytes.

Returns
intPayload size in bytes.
@abstractmethod
async def store(self, directory: str = '', disk: str | None = None, visibility: str | None = None) -> IFile: (source)

Persist the payload under a generated hash name.

Parameters
directory:strRoot-relative target directory on the disk.
disk:str | NoneDisk name, or None for the default disk.
visibility:str | NoneVisibility to apply, or None for the medium default.
Returns
IFileFile object pointing at the stored file.
@abstractmethod
async def storeAs(self, directory: str, name: str, disk: str | None = None, visibility: str | None = None) -> IFile: (source)

Persist the payload under an explicit file name.

Parameters
directory:strRoot-relative target directory on the disk.
name:strTarget file name without directory separators.
disk:str | NoneDisk name, or None for the default disk.
visibility:str | NoneVisibility to apply, or None for the medium default.
Returns
IFileFile object pointing at the stored file.
Raises
StoragePathExceptionIf name is empty or contains a directory separator.
__slots__: tuple = (source)

Undocumented