Skip to main content

Exiv2 wrapper for Python >= 3.4 on Windows

None

Project description

=======
What is it?
=======

Low-level wrappers for exiv2 for python >= 3.4 that pip installs on Windows.

* it only works on Windows.
* it only supports Iptc
* low-level exposure of the C++ methods. Feel free to write a more pythonic interface on top.

=======
How do I set it up?
=======

* pip install exiv2

=======
Example
=======

::

from exiv2 import lowlevel as exiv2

im = exiv2.ImageFactory_open("out.jpg")
exiv2.Image_readMetadata(im)
iptc_data = exiv2.Image_iptcData(im)
key = "Iptc.Application2.Caption"
datum = exiv2.IptcData_operator_bracket(iptc_data, key)
value = exiv2.Iptcdatum_toString(datum)
assert value == "*insert title here*"

# change metadata
result = exiv2.Iptcdatum_setValue(datum, "Hi Mum!")
assert result == 0

# make a new key
key = "Iptc.Application2.Copyright"
datum = exiv2.IptcData_operator_bracket(iptc_data, key)
result = exiv2.Iptcdatum_setValue(datum, "(c) 2018")
assert result == 0

# clear exif and xmp data so we're sure we'll see the ipct data in
# the file properties in windows explorer
exiv2.Image_clearExifData(im)
exiv2.Image_clearXmpData(im)

# write
exiv2.Image_writeMetadata(im)

exiv2.Image_delete(im)



Project details

None

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

exiv2-0.1-cp36-cp36m-win_amd64.whl (1.0 MB view hashes)

Uploaded CPython 3.6m Windows x86-64

exiv2-0.1-cp36-cp36m-win32.whl (864.8 kB view hashes)

Uploaded CPython 3.6m Windows x86

exiv2-0.1-cp35-cp35m-win_amd64.whl (1.0 MB view hashes)

Uploaded CPython 3.5m Windows x86-64

exiv2-0.1-cp35-cp35m-win32.whl (864.8 kB view hashes)

Uploaded CPython 3.5m Windows x86

exiv2-0.1-cp34-cp34m-win_amd64.whl (1.0 MB view hashes)

Uploaded CPython 3.4m Windows x86-64

exiv2-0.1-cp34-cp34m-win32.whl (864.8 kB view hashes)

Uploaded CPython 3.4m Windows x86

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