Skip to main content

Extract and insert GraphPad PRISM objects from Microsoft Office documents (PowerPoint, Word, Excel) on macOS

Project description

PRISM OLE Handler

CI

Extract and insert GraphPad PRISM objects from Microsoft Office documents (PowerPoint, Word, Excel) on macOS.

Background

Microsoft Office for Mac doesn't support direct editing of embedded PRISM objects (OLE), unlike Windows. This package provides tools to extract embedded PRISM objects from Office documents so they can be edited in PRISM and re-embedded.

Currently supports:

  • PowerPoint (.pptx) - Full support
  • Word (.docx) - Planned
  • Excel (.xlsx) - Planned

Installation

From PyPI (recommended)

pip install prism-ole-handler

From source

git clone https://github.com/armish/prism-ole-handler.git
cd prism-ole-handler
pip install -e .

Development installation

pip install -e ".[dev]"

Usage

Extraction:

# Extract from all slides
prism-extract presentation.pptx -o output_folder

# Extract from specific slide
prism-extract presentation.pptx --slide 2 -o output_folder

# Extract from multiple slides
prism-extract presentation.pptx --slide 2 --slide 3 --slide 5 -o output_folder

# Extract from multiple slides (comma-separated)
prism-extract presentation.pptx --slides 2,3,5 -o output_folder

This provides:

  • Selective extraction by slide number
  • Better OLE compound document parsing
  • Slide number tracking for each object
  • More detailed extraction information

Output

Extracted files will be saved with descriptive names:

  • slide1_object1.pzfx - PRISM file from slide 1
  • slide2_object1.ole - Unprocessed OLE file for investigation
  • object1_stream_Package.bin - Extracted OLE stream

How it works

  1. PPTX files are ZIP archives containing XML and embedded objects
  2. Embedded objects are stored in ppt/embeddings/ as .bin files
  3. These .bin files are often OLE compound documents containing PRISM data
  4. The tool extracts and identifies PRISM XML data from these containers

Insertion

To re-insert updated PRISM objects back into PowerPoint:

# Update an existing slide (replace existing embedding)
prism-insert presentation.pptx --slide 2 --prism updated_graph.pzfx

# Insert into empty slide
prism-insert presentation.pptx --slide 3 --prism new_graph.pzfx

# Create new slide with PRISM object
prism-insert presentation.pptx --slide 10 --prism graph.pzfx --create-new

# Update multiple slides
prism-insert presentation.pptx --slide 2 --prism graph1.pzfx --slide 3 --prism graph2.pzfx

# Add to slides that already have embeddings
prism-insert presentation.pptx --slide 2 --prism additional_graph.pzfx --force-insert

The insertion tool:

  • Replaces existing embeddings by default
  • Inserts into empty slides automatically
  • Creates new slides with --create-new flag
  • Adds multiple objects to slides with --force-insert
  • Creates a backup of the original file
  • Updates the OLE containers with new PRISM data
  • Preserves the visual representation streams
  • Maintains all PowerPoint relationships

Complete Workflow

  1. Extract PRISM objects from PowerPoint:

    prism-extract presentation.pptx -o extracted_files
    
  2. Edit the extracted .pzfx files in GraphPad PRISM

  3. Insert the updated files back into PowerPoint:

    # Replace existing object
    prism-insert presentation.pptx --slide 2 --prism extracted_files/slide2_updated.pzfx
    
    # Add to new slide
    prism-insert presentation.pptx --slide 10 --prism extracted_files/new_graph.pzfx --create-new
    

Python API

You can also use the package programmatically:

from prism_ole_handler import PrismExtractor, PrismInserter

# Extract PRISM objects from PowerPoint
extractor = PrismExtractor("presentation.pptx")
extractor.extract_prism_objects("output_folder", selected_slides=[2, 3])

# Insert PRISM objects into PowerPoint
inserter = PrismInserter("presentation.pptx")
inserter.insert_prism_object(slide_num=2, prism_file_path="graph.pzfx")

Limitations

  • OLE files have size constraints - very large PRISM files may not fit
  • Complex OLE structures may require manual investigation
  • Visual representation is preserved but may not reflect all changes
  • Only .pzfx format supported for insertion (not .prism files)

File Format Notes

  • Extraction: Creates .pzfx files that can be opened in PRISM
  • Insertion: Requires .pzfx files (not .prism files)
  • Conversion: Open .prism files in PRISM and save as .pzfx format

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prism_ole_handler-0.1.0.tar.gz (199.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prism_ole_handler-0.1.0-py3-none-any.whl (193.1 kB view details)

Uploaded Python 3

File details

Details for the file prism_ole_handler-0.1.0.tar.gz.

File metadata

  • Download URL: prism_ole_handler-0.1.0.tar.gz
  • Upload date:
  • Size: 199.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for prism_ole_handler-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8a6b897cdcb75a7cf8585dcf9077ff44a89a60ebe3b1e7acc2e23e78b6f936ce
MD5 6414473e414c580e04af69ae0c78b7cc
BLAKE2b-256 b8fa2a656581e1628f9ed433bf9695f8ca76fc43648b374d06c7f06dbb7ef235

See more details on using hashes here.

File details

Details for the file prism_ole_handler-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for prism_ole_handler-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 183b381d2e8aae24a6218c4164325bea9734f950d385ce762568f8530ba15035
MD5 23dc354e4d3f01b99e481af0bacb2bc5
BLAKE2b-256 b22a7acd355dafd37b8075921f5ca1ae41fb333752acfa8fc5e0cb02eb365dcb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page