Metadata-Version: 2.1
Name: pyexiv2
Version: 1.1.0
Summary: Read and modify metadata of digital image, including EXIF, IPTC, XMP.
Home-page: https://github.com/LeoHsiao1/pyexiv2
Author: LeoHsiao
Author-email: leohsiao@foxmail.com
License: UNKNOWN
Description: # pyexiv2
        
        Read and modify metadata of digital image, including EXIF, IPTC, XMP.
        It runs on C++ API of [exiv2](https://www.exiv2.org/index.html).
        
        - install: `pip install pyexiv2`
        - [source code on github](https://github.com/LeoHsiao1/pyexiv2)
        
        ## Features
        
        - Supported platforms: Linux 64bit, Windows 64bit
        - Works with Python3 (64bit)
        - Support for image paths and data that contain unicode characters.
        - Not thread-safe, because some global variables have been used in API.
        
        ## Usage
        
        - read metadata
        
            ```python
            >>> from pyexiv2 import Image
        
            >>> i = Image("tests/1.jpg")
            >>> i.read_exif()
            {'Exif.Image.DateTime': '2019:06:23 19:45:17', 'Exif.Image.Artist': 'TEST', 'Exif.Image.Rating': '4', ...}
            >>> i.read_iptc()
            {'Iptc.Envelope.CharacterSet': '\x1b%G', 'Iptc.Application2.ObjectName': 'TEST', 'Iptc.Application2.Keywords': 'TEST', ...}
            >>> i.read_xmp()
            {'Xmp.dc.format': 'image/jpeg', 'Xmp.dc.rights': 'lang="x-default" TEST', 'Xmp.dc.subject': 'TEST', ...}
            ```
        
        - modify metadata
        
            ```python
            >>> # prepare the XMP data you want to modify
            >>> _dict = {"Xmp.xmp.CreateDate": "2019-06-23T19:45:17.834",   # this will overwrite its original value, or add it if it doesn't exist
            ...          "Xmp.xmp.Rating": ""}  # this will delete the datum in the image
            }
        
            >>> i.modify_xmp(_dict)
            >>> xmp_dict = i.read_xmp()         # read it again
            >>> xmp_dict["Xmp.xmp.CreateDate"]
            '2019-06-23T19:45:17.834'           # it has been set
            >>> xmp_dict["Xmp.xmp.Rating"]
            KeyError: 'Xmp.xmp.Rating'          # it has been deleted
        
            # use i.modify_exif() and i.modify_iptc() in the same way
            ```
        
        - Metadata reference tables: <https://www.exiv2.org/metadata.html>
        
        - You may be interested in these metadata on Windows:
        
            ```python
            {'Xmp.dc.title': 'lang="x-default" I am title',
            'Xmp.dc.subject': 'label1; label2; label3',
            'Xmp.MicrosoftPhoto.Rating':'75'}
            ```
        
        ## Tests
        
        There are some test cases in folder "pyexiv2/tests". Run them by pytest:
        
        ```shell
        pip install pytest psutil
        pytest -v
        ```
        
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Description-Content-Type: text/markdown
