PyGObject is a Python package which provides bindings for GObject based libraries such as GTK, GStreamer, WebKitGTK, GLib, GIO and many more.

It supports Linux, Windows and macOS and works with Python 3.7+ and PyPy3. PyGObject, including this documentation, is licensed under the LGPLv2.1+.

If you want to write a Python application for GNOME or a Python GUI application using GTK, then PyGObject is the way to go. For more information on specific libraries check out the “Python GTK 3 Tutorial” and the “Python GI API Reference”.

import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk

window = Gtk.Window(title="Hello World")
window.connect("destroy", Gtk.main_quit)

How does it work?


PyGObject uses glib, gobject, girepository, libffi and other libraries to access the C library (libgtk-3.so) in combination with the additional metadata from the accompanying typelib file (Gtk-3.0.typelib) and dynamically provides a Python interface based on that information.

Who Is Using PyGObject?

  • Anaconda - an installation program used by Fedora, RHEL and others

  • D-Feet - an easy to use D-Bus debugger

  • Gaphor - a simple modeling tool

  • Girens - a Plex client for playing movies, TV shows and music from your Plex library

  • GNOME Music - a music player for GNOME

  • GNOME Tweak Tool - a tool to customize advanced GNOME 3 options

  • Gramps - a genealogy program

  • Lollypop - a modern music player

  • Meld - a visual diff and merge tool

  • MyPaint - a nimble, distraction-free, and easy tool for digital painters

  • Nicotine+ - a graphical client for the Soulseek file sharing network

  • Orca - a flexible and extensible screen reader

  • Pithos - a Pandora Radio client

  • Pitivi - a free and open source video editor

  • Quod Libet - a music library manager / player

  • Terminator - The Robot Future of Terminals

  • Transmageddon - a video transcoder

The following applications or libraries use PyGObject for optional features, such as plugins or as optional backends:

  • beets - a music library manager and MusicBrainz tagger

  • gedit- a GNOME text editor

  • matplotlib - a python 2D plotting library

  • Totem - a video player for GNOME