Typing stubs for PyGObject, providing type hints for GLib, GObject, Gtk, Gdk, Gio, and other GNOME libraries. Version 2.17.0 supports Python >=3.10. This package enables static type checking (mypy, pyright) for PyGObject code and is actively maintained alongside PyGObject releases. Release cadence is irregular, tied to GNOME releases and bug fixes.
pip install pygobject-stubsVerified import paths — ran on the pinned version, not inferred.
Quickstart example showing correct import pattern and basic usage for type-checking.
Run mypy with --strict only if you accept suppressing many errors, or use --warn-unused-ignores to track where stubs are missing.
Install PyGObject first: pip install PyGObject && pip install pygobject-stubs
If targetting GTK4, install gtk4-stubs and use from gi.repository import Gtk4 (if available)
Upgrade mypy: pip install 'mypy>=1.0'