piexif
To simplify exif manipulations with python. Writing, reading, and more...
What it is and what it does
Piexif is a pure-Python library for reading, writing, and manipulating EXIF metadata embedded in JPEG and WebP image files. It exposes a small, focused API: load() to extract EXIF as a dictionary, dump() to serialize it back to bytes, insert() to embed EXIF into an image, remove() to strip it, and transplant() to copy EXIF from one image to another. Because it has no compiled dependencies and no runtime requirements, it runs on any Python interpreter—CPython, PyPy, IronPython—and any operating system.
The library is designed for straightforward metadata tasks: inspecting camera settings, GPS coordinates, and timestamps; modifying resolution or orientation tags; or removing sensitive metadata before sharing photos. It integrates naturally with PIL/Pillow for image processing workflows. The API is intentionally minimal (five functions) and the data model is a nested dictionary keyed by EXIF IFD sections ("0th", "Exif", "GPS", "1st"), making it easy to iterate and edit tags without learning a complex abstraction.
Use it for:
- Extract and inspect EXIF metadata from photos to read camera model, GPS location, or timestamp.
- Remove sensitive EXIF data (location, device info) before uploading photos to the web.
- Modify image resolution or orientation tags in EXIF and re-embed them in JPEG files.
- Copy EXIF metadata from one photo to another (e.g., transplant GPS data between images).
- Build a photo metadata editor or batch processing tool that reads and updates EXIF fields.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Piexif reads, writes, and manipulates EXIF metadata in JPEG and WebP images using pure Python with no compiled dependencies.
Yes. Piexif is a stable, zero-dependency pure-Python library for EXIF manipulation with no known vulnerabilities and broad Python version support. Its dormant maintenance is a minor concern for edge cases with new camera formats, but the core EXIF spec is stable and the library is well-suited for straightforward metadata tasks. Install it if you need to read or edit EXIF in JPEG or WebP files without external dependencies.
Install
piexif on PyPI
pip
pip install piexifuv
uv add piexifpoetry
poetry add piexifInstalling piexif
Before you install
Low friction: pure Python wheel with no runtime dependencies. Dormant maintenance (last release 2019-07-01, last commit 2023-11-22) but marked Production/Stable and carries no known vulnerabilities.
License in practice
MIT license (permissive) — you can use, modify, and distribute piexif freely in commercial and private projects with minimal restriction.
Quickstart
pip install piexif
import piexif
exif_dict = piexif.load("photo.jpg")
for ifd in ("0th", "Exif", "GPS", "1st"):
for tag in exif_dict[ifd]:
print(piexif.TAGS[ifd][tag]["name"], exif_dict[ifd][tag])
Verify before relying
- Whether the package's dormant status (no releases since 2019) affects real-world reliability with modern camera EXIF formats.
- Performance characteristics when processing large batches of images or very large EXIF payloads.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 2,601 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,831,654/month — #2,874 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: piexif-1.1.3-py2.py3-none-any.whl
Keywords: exif, jpeg
Tags
More Multimedia packages
MoviePy is a Python library for video editing…
permissive · top 5,000 on PyPI
tinytagReads metadata (artist, title, duration,…
permissive · top 5,000 on PyPI
xhtml2pdfConverts HTML and CSS to PDF documents using…
permissive · top 5,000 on PyPI
ffmpyffmpy is a Python wrapper around FFmpeg that…
permissive · top 5,000 on PyPI
torch-audiomentationsProvides PyTorch-native audio data augmentation…
permissive · top 5,000 on PyPI
artConverts text and generates one-line ASCII art…
permissive · top 5,000 on PyPI
exifRead, modify, and write EXIF metadata in image…
permissive · top 15,000 on PyPI
ExifReadExtracts Exif metadata from digital image files…
unclear · top 5,000 on PyPI
pyexiv2pyexiv2 reads and writes image metadata (EXIF,…
copyleft · top 15,000 on PyPI
PyExifToolPyExifTool is a Python wrapper that…
copyleft · top 15,000 on PyPI
imagesizeReads image file headers to extract dimensions,…
permissive · top 1,000 on PyPI
pi-heifDecodes HEIF/HEIC image files and integrates…
copyleft · top 5,000 on PyPI
pilgramApplies Instagram-style filters and CSS-based…
permissive · top 15,000 on PyPI
pdf2imageConverts PDF files to PIL Image objects by…
permissive · top 1,000 on PyPI
tifffileRead and write TIFF files and TIFF-like formats…
permissive · top 1,000 on PyPI
ImageIOImageIO reads and writes images and video in…
permissive · top 1,000 on PyPI