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.
Hold parsed multipart form fields and uploaded files.
Notes
Stores ordered (name, value) pairs and supports multiple values under the same field name. Implements the context-manager protocol to guarantee all open file handles are released on exit.
| Method | __contains__ |
Return True if at least one item with key exists. |
| Method | __enter__ |
Enter the context manager and return this instance. |
| Method | __exit__ |
Exit the context manager and close all uploaded file handles. |
| Method | __getitem__ |
Return the last value for key using subscript notation. |
| Method | __init__ |
Initialize FormData from an ordered list of (name, value) pairs. |
| Method | __iter__ |
Iterate over unique field names in first-seen insertion order. |
| Method | __len__ |
Return the number of unique field names. |
| Method | __repr__ |
Return the canonical string representation. |
| Method | close |
Close all uploaded file handles to release resources. |
| Method | get |
Return the last value for key, or default. |
| Method | get |
Return every value for key in insertion order. |
| Method | multi |
Return all (name, value) pairs in insertion order. |
| Class Variable | __slots__ |
Declare the instance attribute slots reserved by this class. |
| Instance Variable | _index |
Lookup index used to resolve registered entries. |
| Instance Variable | _items |
Ordered (field_name, value) pairs from the multipart stream parser. Multiple pairs with the same name are preserved in insertion order. |
| Property | all |
Return all (name, value) pairs in insertion order. |
| Property | fields |
Return all text field values grouped by name. |
| Property | files |
Return all uploaded file values grouped by name. |
type[ BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None):
(source)
¶
Exit the context manager and close all uploaded file handles.
| Parameters | |
exctype[BaseException] | None | Exception class if one was raised, otherwise None. |
excBaseException | None | Exception instance if one was raised, otherwise None. |
exctypes.TracebackType | None | Traceback if an exception was raised, otherwise None. |
| Returns | |
None | Always returns None. |
Initialize FormData from an ordered list of (name, value) pairs.
| Parameters | |
items:list[tuple[str, str | orionis.http.payload.uploaded_file.UploadedFile]] | Ordered (field_name, value) pairs from the multipart stream parser. Multiple pairs with the same name are preserved in insertion order. |
| Returns | |
None | Always returns None. |
Iterate over unique field names in first-seen insertion order.
| Returns | |
collections.abc.Iterator[str] | Each unique field name exactly once. |
Return the canonical string representation.
| Returns | |
str | Developer-facing string showing the stored item pairs. |
Close all uploaded file handles to release resources.
| Returns | |
None | Release every upload, including those following a failed close. |
| Raises | |
Exception | The original close failure when only one upload fails. |
ExceptionGroup | All original close failures when more than one upload fails. |
Return the last value for key, or default.
| Parameters | |
key:str | Field name to look up. |
default:object | None, optional | Fallback when key is absent. Defaults to None. |
| Returns | |
object | None | Last str or UploadedFile for key, or default. |
Ordered (field_name, value) pairs from the multipart stream parser. Multiple pairs with the same name are preserved in insertion order.
Return all uploaded file values grouped by name.
| Returns | |
dict[str, list[orionis.http.payload.uploaded_file.UploadedFile]] | Mapping of field names to UploadedFile instances in insertion order. |