Source code for docp_parsers.parsers.pptxparser

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
:Purpose:   This module serves as the public interface for interacting
            with PPTX files and parsing their contents.

:Platform:  Linux/Windows | Python 3.11+
:Developer: J Berendt
:Email:     development@s3dev.uk

:Comments:  n/a

:Example:   For example code usage, please refer to the
            :class:`PPTXParser` class docstring.

"""

# locals
try:
    from ._pptxtextparser import _PPTXTextParser
except ImportError:
    from docp_parsers.parsers._pptxtextparser import _PPTXTextParser


[docs] class PPTXParser(_PPTXTextParser): """PPTX document parser. Args: path (str): Full path to the PPTX document to be parsed. :Example: Extract text from a PPTX file:: >>> from docp_parsers import PPTXParser >>> pptx = PPTXParser(path='/path/to/myfile.pptx') >>> pptx.extract_text() # Access the text on slide 1. >>> pg1 = pptx.doc.slides[1].content """ def __init__(self, path: str): """PPTX parser class initialiser.""" super().__init__(path=path)