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 IViewEnvironment(ABC): (source)
Known subclasses: orionis.view.environment.ViewEnvironment
Define the operations provided by the view-environment wrapper.
The implementation is the sole authority for configuring the underlying template engine's environment (loaders, caches, globals, filters, tests, and extensions). No other class should access the engine environment directly.
| 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 available in all templates. |
| Method | add |
Register a test callable used in Jinja2 is expressions. |
| Method | get |
Return the underlying Jinja2 Environment instance. |
| Class Variable | __slots__ |
Declare that this class introduces no additional instance slots. |
orionis.view.environment.ViewEnvironmentRegister 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. |
orionis.view.environment.ViewEnvironmentRegister a filter callable that templates can apply with |.
| Parameters | |
name:str | Filter name used inside template expressions (e.g. | slug). |
callback:collections.abc.Callable | Function applied to the piped value. The first argument receives the value being filtered. |
| Returns | |
None | No return value. |
orionis.view.environment.ViewEnvironmentRegister a global variable or callable available 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. |
orionis.view.environment.ViewEnvironmentRegister a test callable used in Jinja2 is expressions.
| Parameters | |
name:str | Test name used in template expressions (e.g. is odd). |
callback:collections.abc.Callable | Function that receives the tested value and returns a bool. |
| Returns | |
None | No return value. |
orionis.view.environment.ViewEnvironmentReturn the underlying Jinja2 Environment instance.
Access is intentionally restricted to this method so that all configuration changes flow through the typed helpers above.
| Returns | |
jinja2.Environment | The configured Jinja2 environment. |
orionis.view.environment.ViewEnvironmentDeclare that this class introduces no additional instance slots.