PPTXToolkit
init
- working_directory (str, optional): The default directory for output files. If not provided, it will be determined by the
CAMEL_WORKDIR
environment variable (if set). If the environment variable is not set, it defaults tocamel_working_dir
. - timeout (Optional[float]): The timeout for the toolkit. (default: :obj:
None
)
_resolve_filepath
- file_path (str): The file path to resolve.
_sanitize_filename
- filename (str): The filename to sanitize.
_format_text
- frame_paragraph: The paragraph to format.
- text (str): The text to format.
- set_color_to_white (bool): Whether to set the color to white. (default: :obj:
False
)
_add_bulleted_items
- text_frame (TextFrame): The text frame where text is to be displayed.
- flat_items_list (List[Tuple[str, int]]): The list of items to be displayed.
- set_color_to_white (bool): Whether to set the font color to white. (default: :obj:
False
)
_get_flat_list_of_contents
- items (List[Union[str, List[Any]]]): A bullet point (string or list).
- level (int): The current level of hierarchy.
_get_slide_width_height_inches
- presentation (presentation.Presentation): The presentation object.
_write_pptx_file
- file_path (Path): The target file path.
- content (List[Dict[str, Any]]): The content to write to the PPTX file. Must be a list of dictionaries where: - First element: Title slide with keys ‘title’ and ‘subtitle’ - Subsequent elements: Content slides with keys ‘title’, ‘text’
- template (Optional[str]): The name of the template to use. If not provided, the default template will be used. (default: :obj:
None
)
create_presentation
- content (str): The content to write to the PPTX file as a JSON string. Must represent a list of dictionaries with the following structure: - First dict: title slide
{"title": str, "subtitle": str}
- Other dicts: content slides, which can be one of: * Bullet/step slides:{"heading": str, "bullet_points": list of str or nested lists, "img_keywords": str (optional)}
- If any bullet point starts with ’>> ’, it will be rendered as a step-by-step process. - “img_keywords” can be a URL or search keywords for an image (optional). * Table slides:{"heading": str, "table": {"headers": list of str, "rows": list of list of str}}
- filename (str): The name or path of the file. If a relative path is supplied, it is resolved to self.working_directory.
- template (Optional[str]): The path to the template PPTX file. Initializes a presentation from a given template file Or PPTX file. (default: :obj:
None
)
_handle_default_display
- presentation (presentation.Presentation): The presentation object.
- slide_json (Dict[str, Any]): The content of the slide as JSON data.
_handle_display_image__in_foreground
- presentation (presentation.Presentation): The presentation object.
- slide_json (Dict[str, Any]): The content of the slide as JSON data.
_handle_table
- presentation (presentation.Presentation): The presentation object.
- slide_json (Dict[str, Any]): The content of the slide as JSON data.
_handle_step_by_step_process
- presentation (presentation.Presentation): The presentation object.
- slide_json (Dict[str, Any]): The content of the slide as JSON data.
- slide_width_inch (float): The width of the slide in inches.
- slide_height_inch (float): The height of the slide in inches.
_remove_slide_number_from_heading
- header (str): The header of a slide.
_get_slide_placeholders
- slide (Slide): The slide.