Skip to main content

A packer/unpacker for Apple Keynote presentation files.

Project description

keynote-parser

keynote-parser is a Python module for unpacking and re-packing Apple Keynote .key files. It supports Keynote files generated by Keynote version 8.3 (current as of January 2019).

Keynote uses a proprietary, compressed binary format to store its presentations. This format is comprised of a zip file containing images and videos, as well as Snappy-compressed Protobuf .iwa files containing metadata, text, and all other definitions used in the presentation.

keynote-parser unpacks these component files into .yaml files in a directory, making them editable by text editors and/or scripts, then allows re-packing of these files into a working Keynote archive.

What could you use this for? Well, I use it to allow versioning of Keynote files in Git, which makes diffs more understandable (rather than binary), as well as modifying text in Keynote files in response to external scripts. (e.g.: figures that update from databases before giving a presentation)

Installation

pip install keynote-parser

Usage

# Unpack MyPresentation.key into ./MyPresentation/
keynote-parser MyPresentation.key
# Re-pack ./MyPresentation/ into MyPresentation.out.key 
keynote-parser ./MyPresentation/

# Dump a particular .iwa file into its yaml representation on stdout
keynote-parser ./MyPresentation/Index/test.iwa

# Serialize a .yaml file into its corresponding .iwa file on stdout
# (this will output binary data on stdout - careful!)
keynote-parser ./MyPresentation/Index/test.iwa.yaml > test.iwa

Updates

As keynote-parser includes private Protobuf definitions extracted from a copy of Keynote, new versions of Keynote will inevitably create .key files that cannot be read by keynote-parser. As new versions of Keynote are released, the following steps must be undertaken:

  • Run proto-dump on the new copy of Keynote to dump new Proto files.
    • Any . characters in the Protobuf definitions must be changed to _ characters manually.
  • Connect to a running copy of Keynote with lldb (or any other debugger) and manually copy the results of [TSPRegistry sharedRegistry] into mapping.py.

Credits

keynote-parser was built by Peter Sobot but heavily based on prior work by Sean Patrick O'Brien. A copy of O'Brien's format documentation is included in the docs folder for posterity.

License

All code in this repository is licensed under the MIT License, save for protobuf_patch.py, which contains its own license.

Copyright 2019 Peter Sobot

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.

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

keynote-parser-1.0.0.tar.gz (395.4 kB view details)

Uploaded Source

Built Distributions

keynote_parser-1.0.0-py2.7.egg (829.2 kB view details)

Uploaded Source

keynote_parser-1.0.0-py2-none-any.whl (411.1 kB view details)

Uploaded Python 2

File details

Details for the file keynote-parser-1.0.0.tar.gz.

File metadata

  • Download URL: keynote-parser-1.0.0.tar.gz
  • Upload date:
  • Size: 395.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/2.7.15

File hashes

Hashes for keynote-parser-1.0.0.tar.gz
Algorithm Hash digest
SHA256 44c312a4b9ee1be2049edb2804b9b0c05c8202afb300fab2b0eaf0efadb43d47
MD5 cd5ec0d847723624a0081eba73a63264
BLAKE2b-256 a84b8905c53980531935e4a0b2446faafccfbb07b334940c735bc80fa9c99dc6

See more details on using hashes here.

File details

Details for the file keynote_parser-1.0.0-py2.7.egg.

File metadata

  • Download URL: keynote_parser-1.0.0-py2.7.egg
  • Upload date:
  • Size: 829.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/2.7.15

File hashes

Hashes for keynote_parser-1.0.0-py2.7.egg
Algorithm Hash digest
SHA256 8f59675cc8950f1a19179439583ad145dd1663653aaedb306fbf2d16105440ae
MD5 c4501455d138394b1b63cb62a4c429f3
BLAKE2b-256 6472f37f9f3eeea58c0b68c1e5b1eb0197f815329c8b633d09526637deff842f

See more details on using hashes here.

File details

Details for the file keynote_parser-1.0.0-py2-none-any.whl.

File metadata

  • Download URL: keynote_parser-1.0.0-py2-none-any.whl
  • Upload date:
  • Size: 411.1 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/2.7.15

File hashes

Hashes for keynote_parser-1.0.0-py2-none-any.whl
Algorithm Hash digest
SHA256 a320a51b8c06c976198abf96137503f8cf9710cf44a910445836100e2cfb4561
MD5 553fc2c6706e51e939d85b5ddff9322f
BLAKE2b-256 63d994bff05e36f7532c74809b723ba522d60cd84f94f524f3de90b365ada886

See more details on using hashes here.

Supported by

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