Exiv2 wrapper for Python >= 3.4 on Windows
Project description
Low-level wrapper for exiv2 for python >= 3.3 that pip-installs on Windows.
only works on Windows.
only supports Iptc for now. Exif and Xmp are on their way.
straight-up exposure of the C++ methods. Feel free to write more pythonic classes on top.
How do I set it up?
pip install exiv2
Example
import exiv2 def example1(): image = exiv2.ImageFactory.open(r"c:\test\test.jpg") image.readMetadata() ipc_data = image.iptcData() for datum in ipc_data: print(datum.key(), datum.value().toString()) ipc_data[b'Iptc.Application2.Subject'] = b'subject' image.writeMetadata() def example2(): with open(r"c:\test\test.jpg", "rb") as f: imdata = f.read() im = exiv2.ImageFactory.open(imdata) im.readMetadata() new_iptc_data = exiv2.IptcData() new_iptc_data[b"Iptc.Application2.Caption"] = b'Hi Mom!' im.setIptcData(new_iptc_data) im.clearExifData() im.clearXmpData() im.writeMetadata() io = im.io() size = io.size() buffer = io.read(size) with open(r"c:\test\out.jpg", "wb") as f: f.write(buffer) if __name__ == '__main__': example1() example2()
Project details
Release 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.2-cp36-cp36m-win_amd64.whl
(984.8 kB
view hashes)
exiv2-0.2-cp36-cp36m-win32.whl
(831.8 kB
view hashes)
exiv2-0.2-cp35-cp35m-win_amd64.whl
(984.8 kB
view hashes)
exiv2-0.2-cp35-cp35m-win32.whl
(831.8 kB
view hashes)
exiv2-0.2-cp34-cp34m-win_amd64.whl
(984.7 kB
view hashes)
exiv2-0.2-cp34-cp34m-win32.whl
(831.8 kB
view hashes)
exiv2-0.2-cp33-cp33m-win_amd64.whl
(985.0 kB
view hashes)
exiv2-0.2-cp33-cp33m-win32.whl
(831.7 kB
view hashes)
Close
Hashes for exiv2-0.2-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed47d4fbfe294e7109cddef6fd502bf8473f649111f35aa1754da3694538b9a8 |
|
MD5 | 30f61ba3a423e59530b164fc69a4a549 |
|
BLAKE2b-256 | 3a3a7f7e1c8f83a3b5dfb8e447e1f5ae038be1df29bf69ed94cd7c31a6b5b88a |
Close
Hashes for exiv2-0.2-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe2edec178d154cf7e05914633468ff18b12b4b55bc059ba9eb9017a98f2e157 |
|
MD5 | cc007d1b968ff26e89cd38a249958384 |
|
BLAKE2b-256 | 84ca88f480b22b196e9888842ae2caa512abadb0a3d4dbeec0c5baeb243a4f74 |
Close
Hashes for exiv2-0.2-cp34-cp34m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f625bcb84388461a95e0860714be57276a69216de485cb84534892783da54324 |
|
MD5 | 5027606622eee986fbb9cf7c3d33ea18 |
|
BLAKE2b-256 | c10c229956feef86cc14441e0abf4be1970f3318e4aaffe9b349efae7f03275c |
Close
Hashes for exiv2-0.2-cp33-cp33m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7934268c43083846093e46f296ac4a22ef0fedac0b3c948819afb3d2a836b62 |
|
MD5 | f4713c07ff58bd70908bd2519e3bc1b4 |
|
BLAKE2b-256 | e9def2377c3b95096aea836d8a5cd162a231334fbeb2e39505e44993cfc2e57c |