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.
Prepare named templates for deferred rendering into HTML responses.
Create one orionis.view.pending.PendingView per rendering operation.
Call make synchronously to retain the context and queue response
mutations. Await the returned value to render through the injected
orionis.view.contracts.engine.IViewEngine and obtain an
orionis.http.HTMLResponse.
| Method | __init__ |
Initialise the factory with a rendering engine. |
| Method | make |
Prepare a template render as an awaitable, chainable response. |
| Class Variable | __slots__ |
Declare the instance attribute slots reserved by this class. |
| Instance Variable | _engine |
The view engine used to render templates. |
Initialise the factory with a rendering engine.
| Parameters | |
engine:orionis.view.contracts.engine.IViewEngine | The view engine used to render templates. |
| Returns | |
None | No return value. |
str, *, status_code: HTTPStatus | int = 200, headers: Mapping[ str, str] | None = None, background: BackgroundTask | None = None, context: Mapping[ str, Any] | None = None, **variables: Any) -> PendingView:
(source)
¶
Prepare a template render as an awaitable, chainable response.
Notes
Template lookup and rendering errors are raised when the returned value is awaited, rather than when this method prepares it. Response options are also validated on await; chained mutations are applied after the initial options, in call order.
| Parameters | |
template:str | Template name using dot notation (e.g. 'users.index') or a relative path (e.g. 'users/index.html'). |
statusorionis.http.enums.HTTPStatus | int, optional | HTTP status code for the rendered response. |
headers:collections.abc.Mapping[str, str] | None, optional | Response headers. The SSR marker is added when not supplied. |
background:orionis.background.BackgroundTask | None, optional | Task to run after the response is sent. |
context:collections.abc.Mapping[str, typing.Any] | None, optional | Template variables, including names reserved for response options. |
**variables:typing.Any | Additional template variables, overriding matching context entries. |
| Returns | |
orionis.view.pending.PendingView | Awaitable proxy that renders the template on await and accepts chained response mutators such as withStatusCode(), withHeaders(), withBackground() or withErrors(). |
| Raises | |
TypeError | If context is neither a mapping nor None. |