pptx_renderer.PPTXRenderer#
- class PPTXRenderer(template_path: Union[str, PathLike])[source]#
Bases:
object
PPTX Renderer class
This class is used to render a PPTX template by replacing python statements with the result of evaluating the python statements.
Methods
Register a plugin function.
Render PPTXRenderer template and save to output_path.
- register_plugin(name: str, func: callable)[source]#
Register a plugin function.
The plugin function should take 2 or more arguments. The first argument is the result of evaluating the python statement. The second argument is a dictionary containing the following keys: - shape: The pptx shape object where the placeholder is present - slide: The pptx slide object where the placeholder is present - slide_no: The slide number where the placeholder is present The remaining arguments are the arguments passed to the plugin function
- Parameters:
name (str) – Name of the plugin.
func (callable) – Function to be registered.
- Returns:
None