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.
Encapsulate and configure a Jinja2 Environment instance.
This is the single authorised class for configuring the underlying template engine. All loaders, caches, globals, filters, tests and extensions must be registered through the public methods of this class.
The Jinja2 Environment is built once during construction and
stored internally; no other class may access it directly except through
orionis.view.environment.ViewEnvironment.getJinjaEnvironment.
| Method | __init__ |
Build the Jinja2 environment from the application view configuration. |
| Method | add |
Register a Jinja2 extension class with the environment. |
| Method | add |
Register a filter callable that templates can apply with |. |
| Method | add |
Register a global variable or callable in all templates. |
| Method | add |
Register a test callable used in Jinja2 is expressions. |
| Method | get |
Return the configured Jinja2 Environment instance. |
| Class Variable | __slots__ |
Declare the instance attribute slots reserved by this class. |
| Instance Variable | _jinja |
the engine only ever calls render_async and every template global is awaited by Jinja2. |
Build the Jinja2 environment from the application view configuration.
| Parameters | |
app:orionis.IApplication | Application container used to read view configuration and resolve the base path for relative template directories. |
| Returns | |
None | No return value. |
Register a Jinja2 extension class with the environment.
| Parameters | |
extension:typing.Any | A Jinja2 Extension subclass or its dotted import path. |
| Returns | |
None | No return value. |
| Raises | |
orionis.view.exceptions.ViewException | When the extension cannot be registered by Jinja2. |
Register a filter callable that templates can apply with |.
| Parameters | |
name:str | Filter name referenced inside template expressions (e.g. | slug). |
callback:collections.abc.Callable | Function applied to the piped value. |
| Returns | |
None | No return value. |
Register a global variable or callable in all templates.
| Parameters | |
name:str | Identifier used to reference the value inside templates. |
value:typing.Any | Value or callable to expose as a template global. |
| Returns | |
None | No return value. |
Register a test callable used in Jinja2 is expressions.
| Parameters | |
name:str | Test name referenced inside template is expressions. |
callback:collections.abc.Callable | Function receiving the tested value and returning a bool. |
| Returns | |
None | No return value. |
Return the configured Jinja2 Environment instance.
| Returns | |
jinja2.Environment | The internal Jinja2 environment. Treat as read-only outside this class; all mutations must flow through the typed helpers. |