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

Known subclasses: orionis.view.engine.Jinja2Engine

View In Hierarchy

Define the operations provided by a view engine.

All rendering engines registered with the view system must implement this interface so that the rest of the framework remains decoupled from any concrete template technology.

Async Method render Render a template with the supplied context and return HTML.
Async Method warmup Prepare known templates without evaluating render context when supported.
Class Variable __slots__ Declare that this class introduces no additional instance slots.
async def render(self: Self, template: str, context: dict[str, Any]) -> str: (source)

Render a template with the supplied context and return HTML.

Parameters
template:strTemplate identifier. Engines are free to interpret this string (e.g. dot notation 'users.index' or a bare filename).
context:dict[str, typing.Any]Mapping of variable names to values made available inside the template during rendering.
Returns
strThe rendered HTML string produced by the engine.
Raises
orionis.view.exceptions.ViewTemplateNotFoundExceptionWhen the requested template file cannot be located.
orionis.view.exceptions.ViewRenderExceptionWhen the template engine fails to render the template.
async def warmup(self: Self, *templates: str): (source)

Prepare known templates without evaluating render context when supported.

Parameters
*templates:strTemplate identifiers to prepare before rendering.
Returns
NoneNo return value.
__slots__: tuple = (source)

Declare that this class introduces no additional instance slots.