Skip to content

Graph-Native Infrastructure for Context and Accountable AI Systems

fix: make python-pptx import lazy in pptx_parser to fix CI collection error

KaifAhmad1500d0239e0bc
diff --git a/semantica/parse/pptx_parser.py b/semantica/parse/pptx_parser.py
index cd30114c..f88037de 100644
--- a/semantica/parse/pptx_parser.py
+++ b/semantica/parse/pptx_parser.py
@@ -32,8 +32,6 @@ from dataclasses import dataclass, field
from pathlib import Path
from typing import Any, Dict, List, Optional, Union
-from pptx import Presentation
-
from ..utils.exceptions import ProcessingError, ValidationError
from ..utils.logging import get_logger
from ..utils.progress_tracker import get_progress_tracker
@@ -97,6 +95,13 @@ class PPTXParser:
raise ValidationError(f"File is not a PPTX: {file_path}")
try:
+ try:
+ from pptx import Presentation
+ except ImportError:
+ raise ProcessingError(
+ "python-pptx is required for PPTX parsing. "
+ "Install with: pip install python-pptx"
+ )
prs = Presentation(str(file_path))
# Extract metadata