cube package
cube package contains tools for setting configuration
options and providing the Jinja template context for
the data model in YAML.
cubepackage is available out of the box, it doesn’t need to be installed explicitly- Submit issues to
cubeon GitHub
Reference
config object
This object is used to set configuration options in the cube.py file.
You can set properties of this object, named after supported configuration
options, to values or functions that would be used
as these configuration options.
name argument. In that case, the decorated function will be set as the
configuration option under that name.
TemplateContext class
Instances of this class are used for registering variables, functions, and
filters so that they are accessible from Jinja templates when defining the
data model in YAML.
add_variable
The add_variable method registers a variable so that it’s available in
a Jinja template. Should be called with two arguments, a name and a value
of the variable.
add_function and function
The add_function method registers a function so that it’s callable from
a Jinja template as a Python function. Should be called with two arguments,
a name and a function that will be registered under that name:
template.function decorator with a single name
argument; the decorated function will be registered under that name:
add_filter and filter
The add_filter method registers a function so that it’s callable from
a Jinja template as a Jinja filter. Should be called
with two arguments, a name and a function that will be registered as a filter
under that name:
template.filter decorator with a single name
argument; the decorated function will be registered as a filter under that
name: