Package Overview

All classes live under the PyExifTool library namespace: exiftool

Design

PyExifTool was designed with flexibility and extensibility in mind. The library consists of a few classes, each with increasingly more features.

The base ExifTool class contains the core functionality exposed in the most rudimentary way, and each successive class inherits and adds functionality.

Inheritance diagram of exiftool.ExifToolAlpha
  • exiftool.ExifTool is the base class with core logic to interface with PH’s ExifTool process. It contains only the core features with no extra fluff. The main methods provided are execute() and execute_json() which allows direct interaction with the underlying exiftool process.

    • The API is considered stable and should not change much with future releases.

  • exiftool.ExifToolHelper exposes some of the most commonly used functionality. It overloads some inherited functions to turn common errors into warnings and adds logic to make exiftool.ExifTool easier to use. For example, ExifToolHelper provides wrapper functions to get metadata, and auto-starts the exiftool instance if it’s not running (instead of raising an Exception). ExifToolHelper demonstrates how to extend ExifTool to your liking if your project demands customizations not directly provided by ExifTool.

    • More methods may be added and/or slight API tweaks may occur with future releases.

  • exiftool.ExifToolAlpha further extends the ExifToolHelper and includes some community-contributed not-very-well-tested methods. These methods were formerly added ad-hoc by various community contributors, but no longer stand up to the rigor of the current design. ExifToolAlpha is not up to the rigorous testing standard of both ExifTool or ExifToolHelper. There may be old, buggy, or defunct code.

    • This is the least polished of the classes and functionality/API may be changed/added/removed on any release.

    • NOTE: The methods exposed may be changed/removed at any time.

    • If you are using any of these methods in your project, please Submit an Issue to start a discussion on making those functions more robust, and making their way into ExifToolHelper. (Think of ExifToolAlpha as ideas on how to extend ExifTool, where new functionality which may one day make it into the ExifToolHelper class.)

Fork Origins / Brief History

PyExifTool was originally developed by Sven Marnach in 2012 to answer a stackoverflow question Call exiftool from a python script?. Over time, Sven refined the code, added tests, documentation, and a slew of improvements. While PyExifTool gained popularity, Sven never intended to maintain it as an active project. The original repository was last updated in 2014.

Over the years, numerous issues were filed and several PRs were opened on the stagnant repository. In early 2019, Martin Čarnogurský created a PyPI release from the 2014 code with some minor updates. Coincidentally in mid 2019, Kevin M (sylikc) forked the original repository and started merging the PR and issues which were reported on Sven’s issues/PR page.

In late 2019 and early 2020 there was a discussion started to Provide visibility for an active fork. There was a conversation to transfer ownership of the original repository, have a coordinated plan to communicate to PyExifTool users, amongst other things, but it never materialized.

Kevin M (sylikc) made the first release to the PyPI repository in early 2021. At the same time, discussions were started, revolving around Deprecating Python 2.x compatibility and refactoring the code and classes.

The latest version is the result of all of those discussions, designs, and development. Special thanks to the community contributions, especially Jan Philip Göpfert, Seth P, and Kolen Cheung.

License

PyExifTool is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the licence, or (at your option) any later version, or the BSD licence.

PyExifTool is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

See LICENSE for more details.