Pure Python GObject Introspection Bindings
Project description
GObject Introspection bindings written in pure Python using ctypes and cffi (optional). API compatible with PyGObject.
License: LGPL 2.1+
Requirements:
libgirepository 1.0
cffi 0.6+ (optional)
Development Status:
See the ‘examples’ directory for working examples.
Usage
from pgi.repository import Gtk, GObject
or (preferred)
import pgi pgi.install_as_gi() from gi.repository import Gtk, GObject
Backends
There are two code generation backends for ctypes and cffi. You can set the preferred backend before importing modules:
import pgi pgi.set_backend('ctypes') pgi.set_backend('cffi')
If the backend doesn’t support an operation it will fall back to the other one.
Search paths
Typelibs will be loaded from paths in the environment variable GI_TYPELIB_PATH and /usr/lib/girepository-1.0/.
Shared libraries from paths in LD_LIBRARY_PATH and the default system search paths (see dlopen(3)).
Tests
./setup.py test will run unit tests using PGI and PyGObject
./setup.py test –pgi-only to skip PyGObject tests
./tests/libs/ includes additional libraries that will be used for testing if present. Call make in ./tests/libs/ to build them.
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.