piexif


Namepiexif JSON
Version 1.1.3 PyPI version JSON
download
home_pagehttps://github.com/hMatoba/Piexif
SummaryTo simplify exif manipulations with python. Writing, reading, and more...
upload_time2019-07-01 15:29:23
maintainer
docs_urlNone
authorhMatoba
requires_python>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
licenseMIT
keywords exif jpeg
VCS
bugtrack_url
requirements Pillow Sphinx sphinxcontrib-websupport
Travis-CI
coveralls test coverage No coveralls.
            Piexif
======

|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
-----------------

- Pure Python. So, it runs everywhere where Python runs.
- Easy exif manipulations. Read, write, remove...
- Documented. http://piexif.readthedocs.org/en/latest/

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.

.. |Build Status| image:: https://api.travis-ci.org/hMatoba/Piexif.svg?branch=master
   :target: https://travis-ci.org/hMatoba/Piexif
.. |Windows Build| image:: https://ci.appveyor.com/api/projects/status/github/hMatoba/Piexif?branch=master&svg=true
   :target: https://ci.appveyor.com/project/hMatoba/piexif
.. |Coverage Status| image:: https://coveralls.io/repos/hMatoba/Piexif/badge.svg?branch=master
   :target: https://coveralls.io/r/hMatoba/Piexif?branch=master
.. |docs| image:: https://readthedocs.org/projects/piexif/badge/?version=latest
   :target: https://readthedocs.org/projects/piexif/
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hMatoba/Piexif",
    "name": "piexif",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
    "maintainer_email": "",
    "keywords": "exif,jpeg",
    "author": "hMatoba",
    "author_email": "hiroaki.mtb@outlook.com",
    "download_url": "https://files.pythonhosted.org/packages/fa/84/a3f25cec7d0922bf60be8000c9739d28d24b6896717f44cc4cfb843b1487/piexif-1.1.3.zip",
    "platform": "",
    "description": "Piexif\n======\n\n|Build Status| |Windows Build| |Coverage Status| |docs|\n\n\nTo simplify exif manipulations with Python. Writing, reading, and more... Piexif is pure Python. To everywhere with Python.\n\n\nDocument: http://piexif.readthedocs.org/en/latest/\n\nOnline demo: http://piexif-demo.appspot.com/demo\n\nInstall\n-------\n\n'easy_install'::\n\n    $ easy_install piexif\n\nor 'pip'::\n\n    $ pip install piexif\n\nor download .zip, extract it. Put 'piexif' directory into your environment.\n\nWhy Choose Piexif\n-----------------\n\n- Pure Python. So, it runs everywhere where Python runs.\n- Easy exif manipulations. Read, write, remove...\n- Documented. http://piexif.readthedocs.org/en/latest/\n\nHow to Use\n----------\n\nThere are only just five functions.\n\n- *load(filename)* - Get exif data as *dict*.\n- *dump(exif_dict)* - Get exif as *bytes*.\n- *insert(exif_bytes, filename)* - Insert exif into JPEG, or WebP.\n- *remove(filename)* - Remove exif from JPEG, or WebP.\n- *transplant(filename, filename)* - Transplant exif from JPEG to JPEG.\n\nExample\n-------\n\n::\n\n    exif_dict = piexif.load(\"foo1.jpg\")\n    for ifd in (\"0th\", \"Exif\", \"GPS\", \"1st\"):\n        for tag in exif_dict[ifd]:\n            print(piexif.TAGS[ifd][tag][\"name\"], exif_dict[ifd][tag])\n\nWith PIL(Pillow)\n----------------\n\n::\n\n    from PIL import Image\n    import piexif\n\n    im = Image.open(filename)\n    exif_dict = piexif.load(im.info[\"exif\"])\n    # process im and exif_dict...\n    w, h = im.size\n    exif_dict[\"0th\"][piexif.ImageIFD.XResolution] = (w, 1)\n    exif_dict[\"0th\"][piexif.ImageIFD.YResolution] = (h, 1)\n    exif_bytes = piexif.dump(exif_dict)\n    im.save(new_file, \"jpeg\", exif=exif_bytes)\n\nEnvironment\n-----------\n\nTested 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.\n\nLicense\n-------\n\nThis software is released under the MIT license, see LICENSE.txt.\n\n.. |Build Status| image:: https://api.travis-ci.org/hMatoba/Piexif.svg?branch=master\n   :target: https://travis-ci.org/hMatoba/Piexif\n.. |Windows Build| image:: https://ci.appveyor.com/api/projects/status/github/hMatoba/Piexif?branch=master&svg=true\n   :target: https://ci.appveyor.com/project/hMatoba/piexif\n.. |Coverage Status| image:: https://coveralls.io/repos/hMatoba/Piexif/badge.svg?branch=master\n   :target: https://coveralls.io/r/hMatoba/Piexif?branch=master\n.. |docs| image:: https://readthedocs.org/projects/piexif/badge/?version=latest\n   :target: https://readthedocs.org/projects/piexif/",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "To simplify exif manipulations with python. Writing, reading, and more...",
    "version": "1.1.3",
    "split_keywords": [
        "exif",
        "jpeg"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "7212762d7041cd331c9a4172ea591b20",
                "sha256": "3bc435d171720150b81b15d27e05e54b8abbde7b4242cddd81ef160d283108b6"
            },
            "downloads": -1,
            "filename": "piexif-1.1.3-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7212762d7041cd331c9a4172ea591b20",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
            "size": 20691,
            "upload_time": "2019-07-01T15:43:20",
            "upload_time_iso_8601": "2019-07-01T15:43:20.907670Z",
            "url": "https://files.pythonhosted.org/packages/2c/d8/6f63147dd73373d051c5eb049ecd841207f898f50a5a1d4378594178f6cf/piexif-1.1.3-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "db1e3266fc65001a269183bf2bb02ca5",
                "sha256": "83cb35c606bf3a1ea1a8f0a25cb42cf17e24353fd82e87ae3884e74a302a5f1b"
            },
            "downloads": -1,
            "filename": "piexif-1.1.3.zip",
            "has_sig": false,
            "md5_digest": "db1e3266fc65001a269183bf2bb02ca5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
            "size": 1011134,
            "upload_time": "2019-07-01T15:29:23",
            "upload_time_iso_8601": "2019-07-01T15:29:23.045940Z",
            "url": "https://files.pythonhosted.org/packages/fa/84/a3f25cec7d0922bf60be8000c9739d28d24b6896717f44cc4cfb843b1487/piexif-1.1.3.zip",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2019-07-01 15:29:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "hMatoba",
    "github_project": "Piexif",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "appveyor": true,
    "requirements": [
        {
            "name": "Pillow",
            "specs": [
                [
                    "==",
                    "4.2.1"
                ]
            ]
        },
        {
            "name": "Sphinx",
            "specs": [
                [
                    "==",
                    "1.6.3"
                ]
            ]
        },
        {
            "name": "sphinxcontrib-websupport",
            "specs": [
                [
                    "==",
                    "1.0.1"
                ]
            ]
        }
    ],
    "lcname": "piexif"
}
        
Elapsed time: 0.02627s