pgi
Pure Python GObject Introspection Bindings
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 pgiuv
uv add pgipoetry
poetry add pgiInstalling 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
Tags
More Application Frameworks packages
FastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
textualTextual is a Python framework for building…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
mcpBuild and connect to Model Context Protocol…
permissive · top 1,000 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
PyGObjectPyGObject provides Python bindings for…
copyleft · top 15,000 on PyPI
pywin32-ctypesA pure-Python reimplementation of pywin32 that…
permissive · top 5,000 on PyPI
comtypescomtypes is a pure Python library for defining,…
permissive · top 5,000 on PyPI
typeapiProvides a unified API for reflecting and…
permissive · top 15,000 on PyPI
pypyodbcpypyodbc provides a pure Python ODBC interface…
permissive · top 15,000 on PyPI
pyseccomppyseccomp provides a pure-Python interface to…
permissive · top 5,000 on PyPI
pymongocryptPyMongoCrypt provides Python bindings for…
permissive · top 5,000 on PyPI
mpi4pympi4py provides Python bindings for the Message…
permissive · top 5,000 on PyPI