---
name: pptx-file-validation-ec8899b8df60
description: Validate PowerPoint files using python-pptx when standard file readers fail
---

# PPTX File Validation Workflow

This skill provides a reliable method to validate PowerPoint (.pptx) files when the built-in `read_file` function fails or returns insufficient information.

## When to Use

- `read_file` fails to read a .pptx file
- You need to verify presentation contents (slide count, titles, structure)
- Standard file readers return incomplete or unreadable data

## Step-by-Step Instructions

### Step 1: Detect read_file Failure

Attempt to read the PowerPoint file using `read_file`. If it fails, returns garbled content, or doesn't provide the structural information you need, proceed to Step 2.

### Step 2: Use run_shell with python-pptx

Execute a Python script using `run_shell` with the `python-pptx` library to inspect the presentation:

```bash
python3 -c "
from pptx import Presentation
prs = Presentation('path/to/file.pptx')
print(f'Total slides: {len(prs.slides)}')
for i, slide in enumerate(prs.slides, 1):
    print(f'Slide {i}: {slide.shapes.title.text if slide.shapes.title else \"[No Title]\"}')
"
```

### Step 3: Parse and Validate Output

Analyze the output to verify:
- **Slide count** matches expected number
- **Slide titles** align with required topics
- **Structure** is complete and properly formatted

### Step 4: Report Validation Results

Document the validation findings, including:
- Total number of slides
- List of slide titles
- Any missing or problematic content

## Example Usage

```python
# In your agent workflow
run_shell(command="python3 -c \"from pptx import Presentation; prs = Presentation('output.pptx'); print(f'Slides: {len(prs.slides)}'); [print(f'{i}: {s.shapes.title.text}') for i, s in enumerate(prs.slides, 1) if s.shapes.title]\"")
```

## Prerequisites

Ensure `python-pptx` is available in the environment:

```bash
pip install python-pptx
```

## Benefits

- **Reliable**: Works when built-in readers fail
- **Detailed**: Provides slide-by-slide breakdown
- **Programmatic**: Easy to parse and validate against requirements
- **Lightweight**: No need for PowerPoint software installation

---
Source attribution: AG064
Original project: https://github.com/AG064/OpenSpace/blob/ff671ef61ed6587c49bd54c81cdc751c0b99e363/gdpval_bench/skills/pptx-file-validation/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2026 ✨Data Intelligence Lab@HKU✨

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: AG064
Original project: https://github.com/AG064/OpenSpace/blob/ff671ef61ed6587c49bd54c81cdc751c0b99e363/gdpval_bench/skills/pptx-file-validation/SKILL.md
Attribution basis: Source repository record

Fields of work: Content & Media, Development & Engineering, Project & Program Management
Roles: Frontend Developer, Project Manager, Technical Writer
Specialties: Backend, Testing
Tools: Python Pptx
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: dda69cab71f79b6758305af90c4c55d543d27676b4a04f11cc0bb48a9ecd9fc9
