skillfed

pgi

Pure Python GObject Introspection Bindings

pgi v0.0.11.2 94.8K downloads/30d#13,304 on PyPI74
Copyleft license LGPL-2.1+ Active released

What it is and what it does

PGI is a pure Python implementation of GObject Introspection bindings, designed as an alternative to PyGObject. It uses ctypes and optionally cffi to wrap GObject libraries without requiring compiled C extensions, supporting CPython 2.7, CPython 3.3+, PyPy 1.9+, and PyPy3 2.3+.

The package is explicitly pre-alpha and incomplete—the description warns that most features beyond the working examples are unsupported. It requires libgirepository 1.0 as a system dependency and loads type information from standard GObject paths. The latest release was 2018-06-25, though the repository remains active.

Use it for:

  • Access GObject libraries from Python without installing compiled dependencies
  • Run GObject-based code on PyPy or other Python implementations where alternatives may not be available
  • Prototype GObject bindings in pure Python before committing to compiled solutions
  • Embed GObject library access in environments where system package management is restricted

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

PGI provides pure Python bindings to GObject Introspection using ctypes and cffi, allowing access to GObject-based libraries from Python without compiled extensions.

No, not recommended for production use. The package is pre-alpha with explicit warnings that most features are unimplemented, has not been released since 2018, and requires system-level GObject dependencies that add friction. Use only if you have a specific need for pure Python implementation or PyPy compatibility and are prepared to work within its documented limitations.

Install

pgi on PyPI

pip

pip install pgi

uv

uv add pgi

poetry

poetry add pgi

Installing pgi

Before you install

Install friction is high: the package requires libgirepository 1.0 as a system dependency. The latest release was 2018-06-25, but the repository remains active with recent commits, suggesting ongoing maintenance despite the release gap.

License in practice

Licensed under LGPL-2.1+, a copyleft license. Any software linking or distributing this package must comply with LGPL terms, including making source code available under compatible licensing.

Quickstart

import pgi
pgi.install_as_gi()
from gi.repository import Gtk, GObject

Requires libgirepository 1.0 installed on the system; typelibs must be accessible via GI_TYPELIB_PATH or /usr/lib/girepository-1.0/

Verify before relying

  • Current compatibility with Python versions beyond 3.3 and whether PyPy 1.9+ and PyPy3 2.3+ support remains functional
  • Whether the package works reliably with modern GObject Introspection releases
  • Scope of the 'lots of things not implemented' warning and which GObject features are actually usable

Package facts

License LGPL-2.1+ (copyleft)
Python support not specified
Install friction high — source build required
Runtime dependencies none
Maintenance actively maintained — 2,972 days since the last release
Last repo commit
First released
Downloads 94,784/month — #13,304 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pgi-0.0.11.2.tar.gz

Development Status :: 2 - Pre-AlphaIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.3Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Tags

gobject introspection python bindingsgtk bindings pure pythonctypes gobject wrapperglib python bindingspypy gobject support
gobject-introspectionpure-pythonctypes-wrapper

More Application Frameworks packages