Skip to content

Instantly share code, notes, and snippets.

@Jaakkonen
Jaakkonen / generate.py
Last active August 23, 2025 12:21
Generate python stubs (PEP 561) from GObject introspection spec `.gir` files. Stubs `from gi.repository import *`
"""
Generate `.pyi` files for GObject instrospect libraries
such as Gtk and Gdk.
Python version 3.10
Requires `gobject-introspection` package to be
installed at `/usr/lib/gobject-introspection/`.
Does not support (yet)