finalynx.portfolio.render
ο
Module Contentsο
Classesο
Abstract class used to transform a render format to the output. |
APIο
- class finalynx.portfolio.render.Render(aliases: Optional[Dict[str, str]] = None, agents: Optional[Dict[str, Callable[..., str]]] = None)[source]ο
Abstract class used to transform a render format to the output.
Initialization
Abstract class used by subclasses to render themselves as string with a customizable format. This class offers a
render
method which takes a format as input and outputs the corresponding string. See formatting guidelines for more information.- Parameters:
aliases β A key:value dictionary, defaults to empty. Specified keywords will be recursively transformed into the value until all keywords donβt appear in the text.
agents β A key:value dictionary, defaults to empty. Keywords will be replaced by what the method given as value will output.
- MAX_ALIAS_DEPTHο
10
Maximum recursion depth when replacing aliases to prevent infinite loops.
- render(output_format: str = '[console]', **args: Dict[str, Any]) str [source]ο
Render the instance as a string by following the output format. See formatting guidelines for more information.
- Returns:
A string representation of the instance based on the output format.