File size: 487 Bytes
0a99fe6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from pptx import Presentation

def parse_slides(file_path):

    prs = Presentation(file_path)
    slides = []

    for i, slide in enumerate(prs.slides):

        text_parts = []

        for shape in slide.shapes:
            if hasattr(shape, "text"):
                txt = shape.text.strip()
                if txt:
                    text_parts.append(txt)

        slides.append({
            "index": i + 1,
            "text": "\n".join(text_parts)
        })

    return slides