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.
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 | hash |
Return a random, collision-safe name for the file. |
| Method | mime |
Return the MIME type declared by the client. |
| Async Method | move |
Persist the payload and release the upload buffer. |
| Method | original |
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 | store |
Persist the payload under an explicit file name. |
| Class Variable | __slots__ |
Undocumented |
str, name: str | None = None, disk: str | None = None) -> IFile:
(source)
¶
orionis.storage.UploadedFilePersist the payload while keeping the upload buffer usable.
| Parameters | |
directory:str | Root-relative target directory on the disk. |
name:str | None | Target file name, or None to use a generated hash name. |
disk:str | None | Disk name, or None for the default disk. |
| Returns | |
IFile | File object pointing at the stored file. |
orionis.storage.UploadedFileReturn the lowercase file extension including the dot.
| Returns | |
str | Extension such as '.png', or an empty string when the original name has none. |
orionis.storage.UploadedFileReturn 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 | |
str | Random hexadecimal name with the original extension. |
orionis.storage.UploadedFileReturn the MIME type declared by the client.
| Returns | |
str | None | Declared MIME type, or None when absent. |
str, name: str | None = None, disk: str | None = None) -> IFile:
(source)
¶
orionis.storage.UploadedFileorionis.storage.UploadedFileReturn the sanitized client-supplied file name.
| Returns | |
str | Original file name as reported by the client. |
orionis.storage.UploadedFileRead the full uploaded payload.
| Returns | |
bytes | Complete payload contents. |
orionis.storage.UploadedFileReturn the size of the uploaded payload in bytes.
| Returns | |
int | Payload size in bytes. |
str = '', disk: str | None = None, visibility: str | None = None) -> IFile:
(source)
¶
orionis.storage.UploadedFilestr, name: str, disk: str | None = None, visibility: str | None = None) -> IFile:
(source)
¶
orionis.storage.UploadedFilePersist the payload under an explicit file name.
| Parameters | |
directory:str | Root-relative target directory on the disk. |
name:str | Target file name without directory separators. |
disk:str | None | Disk name, or None for the default disk. |
visibility:str | None | Visibility to apply, or None for the medium default. |
| Returns | |
IFile | File object pointing at the stored file. |
| Raises | |
StoragePathException | If name is empty or contains a directory separator. |