slidespeaker / processing /slide_parser.py
subramaniansrc's picture
Create processing/slide_parser.py
f9a08aa verified
Raw
History Blame Contribute Delete
489 Bytes
from pptx import Presentation
def parse_slides(file_path):
prs = Presentation(file_path)
slides = []
for idx, slide in enumerate(prs.slides):
text_list = []
for shape in slide.shapes:
if hasattr(shape, "text"):
txt = shape.text.strip()
if txt:
text_list.append(txt)
slides.append({
"index": idx + 1,
"text": "\n".join(text_list)
})
return slides