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

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 getJinjaEnvironment.

Method __init__ Build the Jinja2 environment from the application view configuration.
Method addExtension Register a Jinja2 extension class with the environment.
Method addFilter Register a filter callable that templates can apply with |.
Method addGlobal Register a global variable or callable in all templates.
Method addTest Register a test callable used in Jinja2 is expressions.
Method getJinjaEnvironment Return the configured Jinja2 Environment instance.
Class Variable __slots__ Undocumented
Instance Variable _jinja_env Undocumented
def __init__(self, app: IApplication): (source)

Build the Jinja2 environment from the application view configuration.

Parameters
app:IApplicationApplication container used to read view configuration and resolve the base path for relative template directories.
Returns
NoneUndocumented
def addExtension(self, extension: Any): (source)

Register a Jinja2 extension class with the environment.

Parameters
extension:AnyA Jinja2 Extension subclass or its dotted import path.
Returns
NoneUndocumented
Raises
ViewExceptionWhen the extension cannot be registered by Jinja2.
def addFilter(self, name: str, callback: Callable): (source)

Register a filter callable that templates can apply with |.

Parameters
name:strFilter name referenced inside template expressions (e.g. | slug).
callback:CallableFunction applied to the piped value.
Returns
NoneUndocumented
def addGlobal(self, name: str, value: Any): (source)

Register a global variable or callable in all templates.

Parameters
name:strIdentifier used to reference the value inside templates.
value:AnyValue or callable to expose as a template global.
Returns
NoneUndocumented
def addTest(self, name: str, callback: Callable): (source)

Register a test callable used in Jinja2 is expressions.

Parameters
name:strTest name referenced inside template is expressions.
callback:CallableFunction receiving the tested value and returning a bool.
Returns
NoneUndocumented
def getJinjaEnvironment(self) -> jinja2.Environment: (source)

Return the configured Jinja2 Environment instance.

Returns
jinja2.EnvironmentThe internal Jinja2 environment. Treat as read-only outside this class; all mutations must flow through the typed helpers.
_jinja_env: jinja2.Environment = (source)

Undocumented