Skip to main content

Build Status Windows Build Coverage Status docs

To simplify exif manipulations with Python. Writing, reading, and more… Piexif is pure Python. To everywhere with Python.

Document: http://piexif.readthedocs.org/en/latest/

Online demo: http://piexif-demo.appspot.com/demo

Install

‘easy_install’:

$ easy_install piexif

or ‘pip’:

$ pip install piexif

or download .zip, extract it. Put ‘piexif’ directory into your environment.

Why Choose Piexif

How to Use

There are only just five functions.

  • load(filename) - Get exif data as dict.

  • dump(exif_dict) - Get exif as bytes.

  • insert(exif_bytes, filename) - Insert exif into JPEG, or WebP.

  • remove(filename) - Remove exif from JPEG, or WebP.

  • transplant(filename, filename) - Transplant exif from JPEG to JPEG.

Example

exif_dict = piexif.load("foo1.jpg")
for ifd in ("0th", "Exif", "GPS", "1st"):
    for tag in exif_dict[ifd]:
        print(piexif.TAGS[ifd][tag]["name"], exif_dict[ifd][tag])

With PIL(Pillow)

from PIL import Image
import piexif

im = Image.open(filename)
exif_dict = piexif.load(im.info["exif"])
# process im and exif_dict...
w, h = im.size
exif_dict["0th"][piexif.ImageIFD.XResolution] = (w, 1)
exif_dict["0th"][piexif.ImageIFD.YResolution] = (h, 1)
exif_bytes = piexif.dump(exif_dict)
im.save(new_file, "jpeg", exif=exif_bytes)

Environment

Tested on Python 2.7, 3.5+ and PyPy3. Piexif would run even on IronPython. Piexif is OS independent and can run on Google App Engine.

License

This software is released under the MIT license, see LICENSE.txt.

Release files for piexif 1.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for piexif 1.1.3
File Size Uploaded
piexif-1.1.3.zip 1.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for piexif 1.1.3
File Interpreter ABI Platform
piexif-1.1.3-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 1.0 MB

Release files / piexif-1.1.3.zip

Download URL piexif-1.1.3.zip
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
83cb35c606bf3a1ea1a8f0a25cb42cf17e24353fd82e87ae3884e74a302a5f1b
BLAKE2b-256 checksum
How to use checksums
fa84a3f25cec7d0922bf60be8000c9739d28d24b6896717f44cc4cfb843b1487
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.9.1 pkginfo/1.4.1 requests/2.18.1 setuptools/28.8.0 requests-toolbelt/0.8.0 tqdm/4.15.0 CPython/3.6.1

Release files / piexif-1.1.3-py2.py3-none-any.whl

Download URL piexif-1.1.3-py2.py3-none-any.whl
Size 20.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
3bc435d171720150b81b15d27e05e54b8abbde7b4242cddd81ef160d283108b6
BLAKE2b-256 checksum
How to use checksums
2cd86f63147dd73373d051c5eb049ecd841207f898f50a5a1d4378594178f6cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.15

Release history Release notifications | RSS feed

This release

1.1.3 This release

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.0.13

2 release files

1.0.12

2 release files

1.0.10

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.7.1

2 release files

0.7

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page