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

Jinja2-based implementation of IViewEngine.

Converts dot-notation template names to filesystem paths and delegates all rendering to Jinja2's async rendering pipeline (render_async). The synchronous render method of Jinja2 is never called from this class.

Static Method _normalisePath Convert a template identifier to a Jinja2-loader-compatible path.
Method __init__ Initialise the engine with the configured view environment.
Async Method render Render a template asynchronously using Jinja2.
Class Variable __slots__ Undocumented
Instance Variable _environment Undocumented
Instance Variable _jinja Undocumented
def _normalisePath(template: str) -> str: (source)

Convert a template identifier to a Jinja2-loader-compatible path.

Rules applied in order

  1. If the identifier already contains / it is treated as a direct path and returned unchanged (except for extension injection).
  2. Otherwise dot separators are converted to slashes.
  3. A '.html' extension is appended when no file extension is present.
Parameters
template:strRaw template identifier supplied by the caller.
Returns
strNormalised template path suitable for jinja2.Environment.get_template.
def __init__(self, environment: IViewEnvironment): (source)

Initialise the engine with the configured view environment.

Parameters
environment:IViewEnvironmentView environment providing the configured Jinja2 Environment instance.
Returns
NoneUndocumented
async def render(self, template: str, context: dict[str, Any]) -> str: (source)

Render a template asynchronously using Jinja2.

Dot-notation identifiers are converted to slash-delimited paths with a .html suffix automatically appended when the name carries no extension (e.g. 'users.index' → 'users/index.html').

Parameters
template:strTemplate identifier using dot notation or a direct relative path. A .html suffix is appended when absent.
context:dict[str, Any]Variables made available inside the template during rendering.
Returns
strRendered HTML string.
Raises
ViewTemplateNotFoundExceptionWhen the template file cannot be located by the configured loaders.
ViewRenderExceptionWhen Jinja2 raises any error during rendering.

Undocumented

_jinja: jinja2.Environment = (source)

Undocumented