Metadata-Version: 2.5
Name: exploderino
Version: 1.0.1
Summary: Explode Office, OpenDocument, EPUB and XPS documents into directories of readable XML, and implode them back.
Project-URL: Homepage, https://github.com/ChickenWorks/exploderino
Project-URL: Documentation, https://github.com/ChickenWorks/exploderino/tree/main/docs
Project-URL: Repository, https://github.com/ChickenWorks/exploderino
Project-URL: Issues, https://github.com/ChickenWorks/exploderino/issues
Project-URL: Changelog, https://github.com/ChickenWorks/exploderino/blob/main/CHANGELOG.md
Author: Chicken Works
License-Expression: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Keywords: diff,docx,epub,git,odp,ods,odt,office,ooxml,opendocument,pptx,pretty-print,vsdx,xlsx,xml,xps,zip
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Topic :: Office/Business :: Office Suites
Classifier: Topic :: Text Processing :: Markup :: XML
Classifier: Topic :: Utilities
Classifier: Typing :: Typed
Requires-Python: >=3.9
Requires-Dist: lxml>=5.0
Provides-Extra: ole
Requires-Dist: olefile>=0.46; extra == 'ole'
Description-Content-Type: text/markdown

# exploderino

[![CI](https://github.com/ChickenWorks/exploderino/actions/workflows/ci.yml/badge.svg)](https://github.com/ChickenWorks/exploderino/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/exploderino)](https://pypi.org/project/exploderino/)
[![Python versions](https://img.shields.io/pypi/pyversions/exploderino)](https://pypi.org/project/exploderino/)
[![License: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue)][license]

Turn documents into ordinary directories of files, and turn those directories back into
working documents.

Word, Excel, PowerPoint, Visio, OpenDocument, EPUB and XPS files are ZIP archives of XML,
images and other parts. exploderino unpacks them into a directory with readable, indented
XML, so other tools can work on the parts directly: `grep`, `sed`, `git diff`, `jq`, XML
processors, linters, scripts or AI agents. When you're done, it packs the directory back into
a valid document. With no edits, every part comes back with exactly the same content.

```
deck.pptx  ──explode──▶  deck.pptx.exploded/
                            ├── .exploderino.json        manifest used to rebuild
                            ├── [Content_Types].xml
                            ├── _rels/.rels
                            ├── docProps/{app,core}.xml
                            └── ppt/
                                ├── presentation.xml
                                ├── slides/slide1.xml …
                                ├── slideLayouts/ slideMasters/ theme/
                                └── media/image1.png …
           ◀──implode──
```

## Why not just unzip?

`unzip` and `xmllint --format` give you readable XML. Getting a working document back is the
hard part:

- **Reformatting can change the text.** In OpenDocument paragraphs and EPUB chapters,
  whitespace between elements is visible text, so a general-purpose pretty-printer adds or
  removes spaces in the document. exploderino indents only where whitespace is formatting, and
  checks that each part comes back identical before it indents it.
- **`zip -r` builds archives that applications reject.** OpenDocument and EPUB need `mimetype`
  stored first and uncompressed. exploderino records each part's order, compression and
  timestamp, and rebuilds the archive from them.
- **Signatures break.** Re-serializing a signed document's XML invalidates the signature.
  exploderino keeps signed parts byte for byte, so an unedited round trip stays valid.
- **Documents from elsewhere can be hostile.** exploderino rejects path traversal,
  decompression bombs and XML entity attacks, and never runs macros.

`exploderino verify` proves the round trip for any document before you build on it.

## Features

- **Readable parts:** XML is indented for reading, diffing and editing; images, fonts and
  other binary parts are copied as they are.
- **Exact round trips:** unedited documents come back with every part's content unchanged,
  including part order, compression and timestamps.
- **Many formats:** Office Open XML, OpenDocument, EPUB and XPS, detected from file content.
  Legacy `.doc`, `.xls` and `.ppt` files can be inspected read-only.
- **Embedded documents:** a workbook inside a document can be exploded in place, and is
  rebuilt automatically.
- **Safe with untrusted files:** protection against path traversal, decompression bombs and
  XML attacks; encrypted and signed content is detected and preserved.
- **Several ways to run:** a command-line tool, a typed Python API, a Docker image and a
  Makefile, with JSON output for scripts.

## Installation

exploderino needs **Python 3.9 or newer** (tested on 3.9 to 3.15) on **macOS or Linux**.
Windows isn't tested. The only required dependency, `lxml`, is installed automatically.

```bash
# A standalone exploderino command, with legacy .doc/.xls/.ppt support (recommended)
uv tool install 'exploderino[ole]'     # or: pipx install 'exploderino[ole]'

# Or into the current Python environment
pip install 'exploderino[ole]'
```

Leave out `[ole]` if you don't need legacy files; it adds the `olefile` package. After
`pip install`, `python -m exploderino` works too. To upgrade, run `uv tool upgrade
exploderino`, `pipx upgrade exploderino` or `pip install -U exploderino`; to uninstall,
`uv tool uninstall exploderino`, `pipx uninstall exploderino` or `pip uninstall exploderino`.

To try the latest unreleased code, install from GitHub:

```bash
uv tool install 'exploderino[ole] @ git+https://github.com/ChickenWorks/exploderino'
```

### Docker

Each release is published as a multi-platform image (linux/amd64 and linux/arm64) with the
`[ole]` extra. It runs as a non-root user in `/work`, so mount the directory that holds your
documents there; paths are then relative to it.

```bash
docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/work" ghcr.io/chickenworks/exploderino deck.pptx
docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/work" ghcr.io/chickenworks/exploderino deck.pptx.exploded -o deck-edited.pptx
```

`-u "$(id -u):$(id -g)"` makes the files the container writes belong to you. Tags are `X.Y.Z`,
`X.Y` and `latest`. To build the image yourself, run `docker build -t exploderino .` in a
checkout, or use the [Makefile][makefile], which also saves typing these options.

### From source

```bash
git clone https://github.com/ChickenWorks/exploderino.git
cd exploderino
uv tool install '.[ole]'          # a standalone command
uv run exploderino --help         # or run it from the checkout without installing
```

This needs [uv](https://docs.astral.sh/uv/). [CONTRIBUTING.md][contributing] covers setting up
for development.

## Quick start

Point it at a document to explode it, or at an exploded directory to implode it. It works out
which from the path, and detects the document's format from its content, not its extension.

```bash
exploderino deck.pptx                              # explode -> deck.pptx.exploded/
grep -o '<a:t>[^<]*</a:t>' deck.pptx.exploded/ppt/slides/slide1.xml   # inspect or edit
exploderino deck.pptx.exploded -o deck-edited.pptx # implode into a new file
exploderino verify deck.pptx                       # optional: check the round trip
```

Implode never overwrites a file unless you pass `--force`, and the default output name is
usually the original document, so use `-o` to write a new file. The [user guide][guide] has
recipes for extracting text, finding and replacing, swapping images and tracking documents in
git.

## Supported formats

| Family | Extensions | Explode | Implode |
|---|---|---|---|
| Word, Excel, PowerPoint, Visio | `.docx` `.xlsx` `.pptx` `.vsdx` and their macro-enabled, template, add-in and other variants, plus `.xlsb` | Yes | Yes |
| OpenDocument | `.odt` `.ods` `.odp` `.odg` and the other ODF types, including LibreOffice Base `.odb` | Yes | Yes |
| EPUB | `.epub` (EPUB 2 and 3) | Yes | Yes |
| XPS | `.xps` `.oxps` | Yes | Yes |
| Legacy Office (OLE) | `.doc` `.xls` `.ppt`, Visio, Publisher, Project and Outlook files | Read-only, with `[ole]` | No |

[Formats][formats] lists every extension, which parts are pretty-printed, and how password
protection, DRM and digital signatures are handled.

## Documentation

- [Command reference][cli]: every command and option, JSON output and exit codes
- [User guide][guide]: where things are in each format, recipes, adding and removing parts,
  embedded documents
- [Formats][formats]: extensions, pretty-printed parts, protected, signed and legacy files
- [Python API][api]: `explode`, `implode`, `verify` and `read_manifest`
- [How it works][how]: the round-trip guarantee, the manifest, and limitations
- [Safety][safety]: protections against hostile documents and directories
- [Troubleshooting][troubleshooting]: error and warning messages, with fixes
- [Using the Makefile][makefile] and [SBOM][sbom]
- [Changelog][changelog]

## Project status

exploderino is stable and follows [Semantic Versioning](https://semver.org/). Its public
interface is the command line, the JSON output, the Python API and the manifest format: patch
releases fix bugs, minor releases add features without breaking that interface, and only a new
major version changes it incompatibly. The [changelog][changelog] lists every change.

## Contributing

Bug reports, feature requests and pull requests are welcome. [CONTRIBUTING.md][contributing]
explains how to set up a checkout, the checks a change must pass and the pull request process.
Everyone taking part is expected to follow the [Code of Conduct][coc].

## Security

Please report security problems privately, as described in [SECURITY.md][security], not in a
public issue.

## License

exploderino is licensed under the [Apache License 2.0][license]. Copyright 2026 Chicken Works.

<!-- Absolute links, so that they also work in the README on PyPI -->
[api]: https://github.com/ChickenWorks/exploderino/blob/main/docs/python-api.md
[changelog]: https://github.com/ChickenWorks/exploderino/blob/main/CHANGELOG.md
[cli]: https://github.com/ChickenWorks/exploderino/blob/main/docs/cli.md
[coc]: https://github.com/ChickenWorks/exploderino/blob/main/CODE_OF_CONDUCT.md
[contributing]: https://github.com/ChickenWorks/exploderino/blob/main/CONTRIBUTING.md
[formats]: https://github.com/ChickenWorks/exploderino/blob/main/docs/formats.md
[guide]: https://github.com/ChickenWorks/exploderino/blob/main/docs/guide.md
[how]: https://github.com/ChickenWorks/exploderino/blob/main/docs/how-it-works.md
[license]: https://github.com/ChickenWorks/exploderino/blob/main/LICENSE
[makefile]: https://github.com/ChickenWorks/exploderino/blob/main/docs/makefile.md
[safety]: https://github.com/ChickenWorks/exploderino/blob/main/docs/safety.md
[sbom]: https://github.com/ChickenWorks/exploderino/blob/main/docs/sbom.md
[security]: https://github.com/ChickenWorks/exploderino/blob/main/SECURITY.md
[troubleshooting]: https://github.com/ChickenWorks/exploderino/blob/main/docs/troubleshooting.md
