API Reference

Looker Client

class looker_powerpoint.looker.LookerClient[source]

Bases: object

__init__()[source]
async run_query(query_object)[source]

Runs a query against the Looker API.

Parameters:

query_object – The query object containing the necessary parameters.

async make_query(shape_id, filter=None, filter_value=None, filter_overwrites=None, id=None, **kwargs)[source]

Constructs a WriteQuery object based on a Look’s definition and provided parameters. :param id: The ID of the Look. :param filter: The name of the filter to apply. :param filter_value: The value to set for the filter. :param filter_overwrites: A dictionary of filters to overwrite with new values. :param **kwargs: Additional query parameters to set.

Returns:

A WriteQuery object representing the modified query.

Return type:

WriteQuery

Shape Discovery Tools

looker_powerpoint.tools.find_alt_text.cleanse_alt_text(text)[source]

Normalise alternative-text before YAML parsing.

Replaces typographic / “smart” quote characters with their plain ASCII equivalents so that YAML produced by applications that substitute curly quotes (e.g. macOS, Word, PowerPoint) can still be parsed correctly.

Parameters:

text (str) – Raw alternative-text string extracted from a shape.

Returns:

The cleansed string with all known fancy quote variants replaced by straight ASCII quotes.

Return type:

str

looker_powerpoint.tools.find_alt_text.extract_alt_text(shape)[source]

Extracts the alternative text description from a shape’s XML.

Parameters:

shape – A Shape object from pptx.

Returns:

The YAML-parsed value (typically a dict) from the shape’s alternative text, or None if no descr attribute is present or the text is empty.

looker_powerpoint.tools.find_alt_text.get_presentation_objects_with_descriptions(pptx_path)[source]

Extracts all shapes from a PowerPoint presentation and returns them with descriptions.

Parameters:

pptx_path (str) – The path to the PowerPoint presentation file.

Returns:

A list of dictionaries, where each dictionary represents a shape and

contains the shape object, its description, and the slide number. Returns an empty list if the presentation cannot be opened or has no slides/shapes.

Return type:

list