PowerPoint concatenation library using pptx-slide-copier
Project description
pptx-concatenator
A Python library for concatenating PowerPoint presentations using pptx-slide-copier.
Features
- Concatenate multiple PPTX files by appending slides
- Preserve formatting, images, and layouts
- Support for both file paths and Presentation objects
- Simple and intuitive API
- Command-line interface for easy usage
Installation
pip install -e .
For development:
pip install -e ".[dev]"
Requirements
- Python 3.9+
- python-pptx >= 0.6.21
- pptx-slide-copier >= 0.0.5
Usage
Command Line Interface
After installation, you can use the pptx-concat command to concatenate PPTX files directly from the command line:
# Concatenate two presentations
pptx-concat source.pptx target.pptx -o output.pptx
# Concatenate multiple presentations
pptx-concat source.pptx file1.pptx file2.pptx file3.pptx -o output.pptx
# Show help
pptx-concat --help
Python API
Basic Usage
Concatenate two PPTX files:
from pptx_concatenator import concat_pptx
# Simple function to concatenate two PPTX files
concat_pptx("source.pptx", "target.pptx", "output.pptx")
Using the PptxConcatenator Class
from pptx_concatenator import PptxConcatenator
# Concatenate two presentations
result = PptxConcatenator.concat("source.pptx", "target.pptx", "output.pptx")
# Concatenate multiple presentations
result = PptxConcatenator.concat_multiple(
"source.pptx",
["target1.pptx", "target2.pptx", "target3.pptx"],
"output.pptx"
)
Working with Presentation Objects
from pptx import Presentation
from pptx_concatenator import PptxConcatenator
# Load presentations
src_prs = Presentation("source.pptx")
target_prs = Presentation("target.pptx")
# Concatenate
result = PptxConcatenator.concat(src_prs, target_prs)
# Save manually
result.save("output.pptx")
Development
Setup Development Environment
make install
Running Tests
# Run tests
make test
# Run tests with coverage
make test-cov
Linting and Formatting
# Run linter
make lint
# Format code
make format
# Check formatting without changes
make format-check
Available Make Commands
make install- Install package and development dependenciesmake test- Run testsmake test-cov- Run tests with coverage reportmake lint- Run ruff lintermake format- Format code with ruffmake format-check- Check formatting without making changesmake clean- Clean build artifacts and cache files
CI/CD
This project uses GitHub Actions for continuous integration:
- Lint: Checks code quality with ruff
- Test: Runs tests on Python 3.8-3.12
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pptx_concatenator-0.1.0.tar.gz.
File metadata
- Download URL: pptx_concatenator-0.1.0.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd471cea514fd26e0adea32d9a2fd028c57e202c41a4521c2109cde315e24aff
|
|
| MD5 |
7c9949660b565314fffcdb03f06a5311
|
|
| BLAKE2b-256 |
b5e45920a4c1eb3e81bb4feee39e555c2c727166ffe6f2fc3f0bfb7346c49778
|
File details
Details for the file pptx_concatenator-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pptx_concatenator-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70b2d03d452605c9b687319777088876858da85412f0fb793a1db79af773f2b9
|
|
| MD5 |
2304a5abdeeecd8dcabb8a9bf4fd5bf0
|
|
| BLAKE2b-256 |
8a967c44d67e1b2d515a8e04c0041ea065ce3ef700c49d1bcc3b6bcae314102d
|