Exiv2 wrapper for Python >= 3.4 on Windows
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)
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
NoneRelease history Release notifications | RSS feed
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-win32.whl
(864.8 kB
view hashes)
exiv2-0.1-cp35-cp35m-win32.whl
(864.8 kB
view hashes)
exiv2-0.1-cp34-cp34m-win32.whl
(864.8 kB
view hashes)
Close
Hashes for exiv2-0.1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94f198f811a9089f4d1ebc6c013f3547c48279a40e253ca40857fa5580c4a08a |
|
MD5 | 47638a080fbb57f21f07e6bfad69632d |
|
BLAKE2b-256 | 36e0f3702dcd42fd9fa243d9ea6eca857765dfa7f94b4236f611620c5552fab5 |
Close
Hashes for exiv2-0.1-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7dc7e95f9e9911b723e58dd97360d419acac726d8f4e786b7bc8c6c12c8d9a7 |
|
MD5 | c4835f8497311b730faf53f9cd68383b |
|
BLAKE2b-256 | f2d461a8246e57f37bfa062c372fc2d15a662486ee7454fb69676dc0370b4730 |
Close
Hashes for exiv2-0.1-cp34-cp34m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d314ac99dcfec0681e7a8cd3159db38712b354d9504d1b9cb58f662d6f57e68c |
|
MD5 | e004f975176db9fdac2119790c1d6b03 |
|
BLAKE2b-256 | 68de178b8807c33e46d3d963d3d33a0ab4f7123e72c5b45005cca55a01cbf5e1 |