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 IUploadedFile(ABC): (source)
Known subclasses: orionis.http.payload.uploaded_file.UploadedFile
Define the contract for an uploaded file held in memory or on disk.
Implementations buffer incoming bytes via write(), optionally spill to a temporary file, and expose content through read() and save().
| Method | chunks |
Iterate over the file content in fixed-size chunks. |
| Method | close |
Close the file handle and release all associated resources. |
| Method | read |
Read the entire file content from the beginning. |
| Method | replace |
Replace the file content with data and update the byte counter. |
| Method | save |
Write the file contents to path on the local filesystem. |
| Method | write |
Append chunk to the file buffer. |
| Class Variable | __slots__ |
Declare that this class introduces no additional instance slots. |
| Property | extension |
Return the file extension derived from filename, in lowercase. |
| Property | size |
Return the total number of bytes written so far. |
orionis.http.payload.uploaded_file.UploadedFileIterate over the file content in fixed-size chunks.
| Parameters | |
size:int | Maximum number of bytes per yielded chunk. |
| Returns | |
collections.abc.Iterator[bytes] | Iterator yielding consecutive chunks from the beginning of the buffered content. |
orionis.http.payload.uploaded_file.UploadedFileClose the file handle and release all associated resources.
| Returns | |
None | Close the file handle and release all associated resources. |
orionis.http.payload.uploaded_file.UploadedFileRead the entire file content from the beginning.
| Returns | |
bytes | Full file contents. |
orionis.http.payload.uploaded_file.UploadedFileWrite the file contents to path on the local filesystem.
| Parameters | |
path:str or pathlib.Path | Destination path for the saved file. |
| Returns | |
None | Write the file contents to path on the local filesystem. |
orionis.http.payload.uploaded_file.UploadedFileAppend chunk to the file buffer.
Append at the end even when a previous read moved the cursor.
| Parameters | |
chunk:bytes | bytearray | memoryview | Raw bytes to append. |
| Returns | |
None | Append chunk to the file buffer. |
orionis.http.payload.uploaded_file.UploadedFileDeclare that this class introduces no additional instance slots.
orionis.http.payload.uploaded_file.UploadedFileReturn the file extension derived from filename, in lowercase.
| Returns | |
str | Lowercase suffix including the leading dot (e.g. ".png"). Empty string if the filename has no extension. |
orionis.http.payload.uploaded_file.UploadedFileReturn the total number of bytes written so far.
| Returns | |
int | Cumulative byte count across all write calls. |