how to use gexiv2 in python?

  • Last Update :
  • Techknowledgy :

I just compiled exiv2 and gexiv2 for my debian machiene and now I want to start working with gexiv2 to edit IPTC data using python. The gexiv2 website presents the following line of code:

from gi.repository
import GExiv2

But that already results in:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
      ImportError: No module named gi.repository

The following error occurs when importing GExiv2:

>>> from gi.repository
import GExiv2
ERROR: root: Could not find any typelib
for GExiv2

Suggestion : 2

gexiv 0.12.3 released on Aug 17th, 2021,

To obtain the source:

git clone https: //gitlab.gnome.org/GNOME/gexiv2

Suggestion : 3

Read-only mirror of https://gitlab.gnome.org/GNOME/gexiv2 , Read-only mirror of https://gitlab.gnome.org/GNOME/gexiv2 , Clone HTTPS GitHub CLI Use Git or checkout with SVN using the web URL. Work fast with our official CLI. Learn more.

    gexiv2 - A GObject - based Exiv2 wrapper
       -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

       *
       Introduction

    gexiv2 is a GObject - based wrapper around the Exiv2 library.It makes the
    basic features of Exiv2 available to GNOME applications.

    Visit https: //wiki.gnome.org/gexiv2 to read about the current state of
       gexiv2 's development and to make sure you'
    re running the latest version.

       *Installation & Licensing

    Please consult the INSTALL and COPYING files
    for more information.

       *Contacting the developers

    gexiv2 project page: https: //wiki.gnome.org/Projects/gexiv2

       We also encourage you to discuss gexiv2 on GNOME Discourse.See
    https: //discourse.gnome.org/tag/gexiv2 for details.

       Copyright 2016 Software Freedom Conservancy Inc.

Suggestion : 4

sirgazil Mon, 17 Jun 2019 12:27:46 -0700

1._
Hi,

I used to use a python script to clear image metadata in Debian:
Hi,

I used to use a python script to clear image metadata in Debian:
import gi
gi.require_version("GExiv2", "0.10")
from gi.repository import GExiv2


metadata = GExiv2.Metadata("/tmp/something.png")
metadata.clear()


I'm trying to make this work in the GNU system I installed with Guix, but I
haven't been able to. So far, I have installed the following packages with guix:

gobject-introspection 1.56.1
python 3.70
python-pygobject 3.28.3
gexiv2 0.10.10

I've also added the output of "guix package --search-paths" to my
".bash_profile".

However, when I run the script above, I get the following error:


$ python3 img-clear-metadata.py
Traceback (most recent call last):
File "img-clear-metadata.py", line 2, in <module>
   gi.require_version("GExiv2", "0.10")
   File
   "/home/sirgazil/.guix-profile/lib/python3.7/site-packages/gi/__init__.py", line
   130, in require_version
   raise ValueError('Namespace %s not available' % namespace)
   ValueError: Namespace GExiv2 not available


   I don't know what I'm missing...


   I'm using this guix:

   $ LANG=C guix describe
   Generation 3 Jun 15 2019 09:49:31 (current)
   guix ddd401d
   repository URL: https://git.savannah.gnu.org/git/guix.git
   branch: master
   commit: ddd401d28fb09f1f8ce96f2fc24226887a812412


   ---
   https://sirgazil.bitbucket.io/