{"id":30296007,"url":"https://github.com/adbertram/powerpoint_context_extractor","last_synced_at":"2025-08-17T02:39:36.105Z","repository":{"id":297798964,"uuid":"997935004","full_name":"adbertram/powerpoint_context_extractor","owner":"adbertram","description":"Extracts context for AI from PowerPoint slide decks.","archived":false,"fork":false,"pushed_at":"2025-06-07T23:45:41.000Z","size":80,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-16T20:55:31.506Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adbertram.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-07T14:11:08.000Z","updated_at":"2025-08-13T15:13:57.000Z","dependencies_parsed_at":"2025-06-07T15:34:56.986Z","dependency_job_id":null,"html_url":"https://github.com/adbertram/powerpoint_context_extractor","commit_stats":null,"previous_names":["adbertram/powerpoint_context_extractor"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/adbertram/powerpoint_context_extractor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adbertram%2Fpowerpoint_context_extractor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adbertram%2Fpowerpoint_context_extractor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adbertram%2Fpowerpoint_context_extractor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adbertram%2Fpowerpoint_context_extractor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adbertram","download_url":"https://codeload.github.com/adbertram/powerpoint_context_extractor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adbertram%2Fpowerpoint_context_extractor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270799868,"owners_count":24648130,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-17T02:39:31.745Z","updated_at":"2025-08-17T02:39:36.090Z","avatar_url":"https://github.com/adbertram.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PowerPoint Context Extractor\n\nA comprehensive toolkit for extracting content and metadata from PowerPoint presentations, including slide notes, animations, and slide content.\n\n## Overview\n\nPowerPoint Context Extractor is a modular Python toolkit designed to extract and analyze various elements from PowerPoint (.pptx) files. It provides tools to extract:\n\n- **Slide Notes**: Detailed presenter notes from each slide\n- **Animations**: Animation sequences, effects, and transitions\n- **Slide Content**: Titles, text, and other content elements\n- **Slide Images**: Export slides as images in various formats\n\nThe toolkit uses a combination of the `python-pptx` library and direct XML parsing to access content that might not be easily accessible through the standard API.\n\n## Features\n\n- **Notes Extraction**: Extract detailed presenter notes from PowerPoint slides\n- **Animation Detection**: Identify and document animations, transitions, and effects\n- **Content Analysis**: Extract slide titles, content, and structure\n- **Combined Output**: Generate comprehensive JSON files containing all extracted information\n- **AI-Powered Recommendations**: Generate usage recommendations for each slide using LLM analysis (supports both Anthropic Claude and Google Gemini)\n- **Detailed Logging**: Track the extraction process with informative logs\n- **Modular Architecture**: Clean separation of concerns for maintainability and extensibility\n\n## Requirements\n\n### Core Dependencies\n- Python 3.6+\n- python-pptx\n- Pillow (for image extraction)\n- pdf2image (for slide conversion)\n- LibreOffice (for PPTX to PDF conversion)\n- Poppler (for PDF to image conversion)\n\n### AI Features (Optional)\n- anthropic (for Claude AI recommendations)\n- google-generativeai (for Gemini AI recommendations)\n- python-dotenv (for environment variable management)\n\n## Installation\n\n1. Clone this repository:\n   ```bash\n   git clone https://github.com/adbertram/powerpoint_context_extractor.git\n   ```\n\n2. Install the package and dependencies:\n   ```bash\n   # Install basic dependencies\n   pip install -r requirements.txt\n   \n   # Or install the package (includes console script)\n   pip install -e .\n   ```\n\n3. Install system dependencies (for slide extraction):\n   - LibreOffice: For converting PPTX to PDF\n   - Poppler: For converting PDF to images\n\n   On macOS:\n   ```bash\n   brew install libreoffice poppler\n   ```\n\n   On Ubuntu/Debian:\n   ```bash\n   sudo apt-get install libreoffice poppler-utils\n   ```\n\n## Usage\n\n### Main Command-Line Interface\n\nThe main script `pptx_extract.py` provides a unified interface for all extraction features:\n\n```bash\npython pptx_extract.py path/to/presentation.pptx [options]\n```\n\nOptions:\n- `--output DIR, -o DIR`: Output directory (default: ./output)\n- `--extract TYPE`: What to extract - options: images, notes, animations, all (default: all)\n- `--slide-nums RANGES`: Process specific slides (e.g., \"1-5,7,10-12\")\n- `--format FORMAT, -f FORMAT`: Image format for slides (png, jpg, jpeg, tiff, bmp; default: png)\n- `--dpi DPI, -d DPI`: Image resolution for slides (default: 300)\n- `--recommend, -r`: Generate AI-powered usage recommendations for each slide (requires API key)\n- `--recommendation-method METHOD`: Method for recommendations (\"text\" or \"images\", default: text)\n- `--api-key API_KEY`: API key for LLM service (can also use ANTHROPIC_API_KEY or GOOGLE_API_KEY env var)\n- `--llm-provider PROVIDER`: LLM provider to use (\"anthropic\" or \"google\", default: anthropic)\n- `--config CONFIG`: Path to custom configuration file\n- `--verbose, -v`: Enable verbose logging\n\n### Alternative CLI Interface\n\nYou can also use the console script (after `pip install -e .`):\n\n```bash\npptx-extract path/to/presentation.pptx [options]\n```\n\nOr directly using the main script:\n\n```bash\npython pptx_extract.py path/to/presentation.pptx --extract all\n```\n\n### Examples\n\n#### Extract Everything\n\n```bash\npython pptx_extract.py path/to/presentation.pptx --extract all --output ./output_directory\n```\n\n#### Extract Only Notes\n\n```bash\npython pptx_extract.py path/to/presentation.pptx --extract notes --output ./output_directory\n```\n\n#### Extract Only Animations\n\n```bash\npython pptx_extract.py path/to/presentation.pptx --extract animations --output ./output_directory\n```\n\n#### Extract Slides as Images\n\n```bash\npython pptx_extract.py path/to/presentation.pptx --extract images --format png --dpi 300 --output ./output_directory\n```\n\n#### Extract Specific Slides\n\n```bash\n# Extract slides 1-5, 7, and 10-12\npython pptx_extract.py path/to/presentation.pptx --slide-nums \"1-5,7,10-12\" --output ./output_directory\n\n# Extract only slide 3\npython pptx_extract.py path/to/presentation.pptx --slide-nums \"3\" --output ./output_directory\n```\n\n#### Extract with AI-Powered Recommendations\n\n##### Using Anthropic Claude (default)\n```bash\n# Text-based recommendations (default)\npython pptx_extract.py path/to/presentation.pptx --extract all --recommend --api-key YOUR_API_KEY\n\n# Image-based recommendations\npython pptx_extract.py path/to/presentation.pptx --extract all --recommend --recommendation-method images --api-key YOUR_API_KEY\n\n# Using environment variable\nexport ANTHROPIC_API_KEY=YOUR_API_KEY\npython pptx_extract.py path/to/presentation.pptx --extract all --recommend\n```\n\n##### Using Google Gemini\n```bash\n# Text-based recommendations\npython pptx_extract.py path/to/presentation.pptx --extract all --recommend --llm-provider google --api-key YOUR_API_KEY\n\n# Image-based recommendations\npython pptx_extract.py path/to/presentation.pptx --extract all --recommend --llm-provider google --recommendation-method images --api-key YOUR_API_KEY\n\n# Using environment variable\nexport GOOGLE_API_KEY=YOUR_API_KEY\npython pptx_extract.py path/to/presentation.pptx --extract all --recommend --llm-provider google\n```\n\n## Output Files\n\nThe toolkit generates the following output files:\n\n- **presentation_content.json**: A unified JSON file containing:\n  - Slide numbers and titles\n  - Notes text\n  - Animation details with human-readable descriptions\n  - Animation summaries\n  - Usage recommendations (when using --recommend option)\n- **slides/**: Directory containing extracted slide images (when using image extraction)\n\n## Configuration\n\nThe toolkit supports extensive configuration through JSON files. You can customize:\n\n- **API Settings**: Model selection, temperature, token limits for both Anthropic and Google\n- **Processing Options**: Timeouts, batch sizes, error handling\n- **Output Settings**: File naming conventions, logging levels\n- **System Integration**: Dependency management, LibreOffice settings\n\n### Creating a Custom Configuration\n\n```bash\n# Use a custom config file\npython pptx_extract.py presentation.pptx --config my_config.json\n```\n\nThe project includes a `config.json.example` file showing all available configuration options. Copy this file to create your own custom configuration:\n\n```bash\n# Copy the example config and customize it\ncp config.json.example my_config.json\n```\n\nKey configuration sections include:\n\n- **cli_defaults**: Override default CLI options (output directory, image format, DPI, etc.)\n- **timeouts**: Configure processing timeouts based on slide count and operations\n- **api_settings**: Customize AI model settings for both Anthropic and Google providers\n- **image_settings**: Control image processing parameters\n- **processing**: Fine-tune conversion and processing behavior\n\nSee `config.json.example` for the complete configuration structure with all available options and their descriptions.\n\n## Project Structure\n\n```text\npowerpoint_context_extractor/\n├── pptx_extract.py             # Main entry point script\n├── pptx_extractor/             # Package directory\n│   ├── __init__.py             # Package initialization\n│   ├── animations/             # Animations extraction module\n│   │   ├── __init__.py\n│   │   └── extractor.py        # Animations extraction functionality\n│   ├── notes/                  # Notes extraction module\n│   │   ├── __init__.py\n│   │   └── extractor.py        # Notes extraction functionality\n│   ├── slides/                 # Slides extraction module\n│   │   ├── __init__.py\n│   │   └── extractor.py        # Slides extraction functionality\n│   ├── recommendations/        # AI-powered recommendations module\n│   │   ├── __init__.py\n│   │   ├── generator.py        # Recommendation generation logic\n│   │   └── system_message.md   # Customizable AI prompts\n│   └── utils/                  # Utility functions\n│       ├── __init__.py\n│       └── common.py           # Common utilities and configuration\n├── setup.py                    # Package setup and console scripts\n├── README.md                   # Project documentation\n├── LICENSE                     # License file\n└── requirements.txt            # Python dependencies\n```\n\n## How It Works\n\nThe toolkit uses two approaches to extract content:\n\n1. **API-based extraction** using the `python-pptx` library for accessing slide metadata, titles, and basic content\n2. **Direct XML parsing** for accessing notes, animations, and other content that might not be easily accessible through the API\n\nFor notes extraction, the tool:\n1. Opens the PPTX file as a ZIP archive\n2. Locates notes XML files in the `ppt/notesSlides/` directory\n3. Parses each XML file to find shapes with placeholder type \"body\"\n4. Extracts text from paragraphs and text runs within these shapes\n5. Associates the extracted notes with the corresponding slides\n\n## Use Cases\n\n- **Content Analysis**: Analyze the content and structure of PowerPoint presentations\n- **Documentation Generation**: Extract presenter notes for documentation purposes\n- **Animation Analysis**: Identify slides with complex animations\n- **Content Migration**: Extract content for migration to other formats or platforms\n- **Accessibility**: Extract notes and content for accessibility purposes\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## Acknowledgments\n\n- [python-pptx](https://python-pptx.readthedocs.io/) library for PowerPoint parsing\n- [Pillow](https://pillow.readthedocs.io/) for image processing\n- [pdf2image](https://github.com/Belval/pdf2image) for PDF to image conversion\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadbertram%2Fpowerpoint_context_extractor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadbertram%2Fpowerpoint_context_extractor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadbertram%2Fpowerpoint_context_extractor/lists"}