| 1 |
.. include:: icons.rst |
| 2 |
|
| 3 |
.. title:: Overview |
| 4 |
|
| 5 |
.. toctree:: |
| 6 |
:hidden: |
| 7 |
:titlesonly: |
| 8 |
:maxdepth: 1 |
| 9 |
|
| 10 |
getting_started |
| 11 |
tutorials/index |
| 12 |
guide/index |
| 13 |
devguide/index |
| 14 |
contact |
| 15 |
|
| 16 |
.. image:: images/pygobject.svg |
| 17 |
:align: center |
| 18 |
:width: 400px |
| 19 |
:height: 98px |
| 20 |
:class: only-light |
| 21 |
|
| 22 |
.. image:: images/pygobject-dark.svg |
| 23 |
:align: center |
| 24 |
:width: 400px |
| 25 |
:height: 98px |
| 26 |
:class: only-dark |
| 27 |
|
| 28 |
| |
| 29 |
|
| 30 |
.. include:: ../README.rst |
| 31 |
:start-after: | |
| 32 |
:end-before: | |
| 33 |
|
| 34 |
If you want to write a Python application for `GNOME |
| 35 |
<https://www.gnome.org/>`__ or a Python GUI application using GTK, then |
| 36 |
PyGObject is the way to go. To get started, check out the "`GNOME Developer Documentation |
| 37 |
<https://developer.gnome.org/documentation/tutorials/beginners.html>`__". For more |
| 38 |
information on specific libraries, check out the |
| 39 |
`GNOME Python API documentation <https://api.pygobject.gnome.org/>`__. |
| 40 |
|
| 41 |
.. code:: python |
| 42 |
|
| 43 |
import gi |
| 44 |
|
| 45 |
gi.require_version("Gtk", "4.0") |
| 46 |
from gi.repository import GLib, Gtk |
| 47 |
|
| 48 |
|
| 49 |
class MyApplication(Gtk.Application): |
| 50 |
def __init__(self): |
| 51 |
super().__init__(application_id="com.example.MyGtkApplication") |
| 52 |
GLib.set_application_name("My Gtk Application") |
| 53 |
|
| 54 |
def do_activate(self): |
| 55 |
window = Gtk.ApplicationWindow(application=self, title="Hello World") |
| 56 |
window.present() |
| 57 |
|
| 58 |
|
| 59 |
app = MyApplication() |
| 60 |
app.run() |
| 61 |
|
| 62 |
|
| 63 |
How does it work? |
| 64 |
----------------- |
| 65 |
|
| 66 |
.. figure:: images/overview.svg |
| 67 |
:width: 600px |
| 68 |
:height: 222px |
| 69 |
:align: center |
| 70 |
:class: only-light |
| 71 |
|
| 72 |
.. figure:: images/overview-dark.svg |
| 73 |
:width: 600px |
| 74 |
:height: 222px |
| 75 |
:align: center |
| 76 |
:class: only-dark |
| 77 |
|
| 78 |
PyGObject uses `GLib <https://docs.gtk.org/glib/>`__, `GObject |
| 79 |
<https://docs.gtk.org/gobject/>`__, `GIRepository |
| 80 |
<https://docs.gtk.org/girepository/>`__, `libffi |
| 81 |
<https://sourceware.org/libffi/>`__ and other libraries to access the C |
| 82 |
library (libgtk-4.so) in combination with the additional metadata from the |
| 83 |
accompanying typelib file (Gtk-4.0.typelib) and dynamically provides a Python |
| 84 |
interface based on that information. |
| 85 |
|
| 86 |
|
| 87 |
Who Is Using PyGObject? |
| 88 |
----------------------- |
| 89 |
|
| 90 |
* `Anaconda <https://fedoraproject.org/wiki/Anaconda>`__ - an installation program used by Fedora, RHEL and others |
| 91 |
* `Apostrophe <https://apps.gnome.org/Apostrophe/>`__ - a Markdown editor |
| 92 |
* `Blanket <https://apps.gnome.org/Blanket/>`__ - listen to different sounds |
| 93 |
* `BleachBit <https://www.bleachbit.org/>`__ - delete unnecessary files from the system |
| 94 |
* `Bottles <https://usebottles.com/>`__ - run Windows software on Linux |
| 95 |
* `Cambalache <https://gitlab.gnome.org/jpu/cambalache>`__ - a user interface maker for GTK |
| 96 |
* `Cozy <https://github.com/geigi/cozy>`__ - the audiobook app for Linux |
| 97 |
* `D-Feet <https://wiki.gnome.org/action/show/Apps/DFeet>`__ - an easy to use D-Bus debugger |
| 98 |
* `Deluge <https://deluge-torrent.org/>`__ - a BitTorrent client |
| 99 |
* `Dialect <https://apps.gnome.org/Dialect/>`__ - a translation app |
| 100 |
* `Drawing <https://maoschanz.github.io/drawing/>`__ - a drawing application |
| 101 |
* `Feeds <https://gfeeds.gabmus.org/>`__ - an RSS/Atom feed reader |
| 102 |
* `Gajim <https://gajim.org/>`__ - a fully-featured XMPP client |
| 103 |
* `Gameeky <https://github.com/tchx84/gameeky>`__ - a learning tool for making games and learning experiences |
| 104 |
* `Gaphor <https://gaphor.org/>`__ - a simple modeling tool |
| 105 |
* `Getting Things GNOME! <https://wiki.gnome.org/Apps/GTG>`__ - a personal task organizer |
| 106 |
* `Girens <https://gitlab.gnome.org/tijder/girens>`__ - a Plex client for playing movies, TV shows and music from your Plex library |
| 107 |
* `GNOME Music <https://apps.gnome.org/Music/>`__ - a music player for GNOME |
| 108 |
* `GNOME Tweaks <https://wiki.gnome.org/Apps/Tweaks>`__ - a tool to customize advanced GNOME options |
| 109 |
* `GNOME Video Player <https://gitlab.gnome.org/GNOME/showtime/>`__ - a GNOME video player |
| 110 |
* `Gramps <https://gramps-project.org/>`__ - a genealogy program |
| 111 |
* `Iotas <https://apps.gnome.org/Iotas/>`__ - simple note taking |
| 112 |
* `Komikku <https://valos.gitlab.io/Komikku/>`__ - a manga reader |
| 113 |
* `Lollypop <https://wiki.gnome.org/Apps/Lollypop>`__ - a modern music player |
| 114 |
* `Lutris <https://lutris.net/>`__ - a video game manager |
| 115 |
* `Meld <https://meldmerge.org/>`__ - a visual diff and merge tool |
| 116 |
* `Metadata Cleaner <https://apps.gnome.org/MetadataCleaner/>`__ - an application to view and clean metadata in files |
| 117 |
* `MyPaint <https://mypaint.app/>`__ - a nimble, distraction-free, and easy tool for digital painters |
| 118 |
* `Nicotine+ <https://nicotine-plus.org/>`__ - a graphical client for the Soulseek peer-to-peer network |
| 119 |
* `Orca <https://wiki.gnome.org/Projects/Orca>`__ - a flexible and extensible screen reader |
| 120 |
* `Paperwork <https://openpaper.work/>`__ - a personal document manager |
| 121 |
* `Pithos <https://pithos.github.io/>`__ - a Pandora Radio client |
| 122 |
* `Pitivi <https://www.pitivi.org/>`__ - a free and open source video editor |
| 123 |
* `Plots <https://github.com/alexhuntley/Plots/>`__ - a graph plotting app |
| 124 |
* `Pulp <https://gitlab.gnome.org/cheywood/Pulp/>`__ - a minimal take on RSS reading |
| 125 |
* `Quod Libet <https://quodlibet.readthedocs.io/>`__ - a music library manager / player |
| 126 |
* `Secrets <https://apps.gnome.org/Secrets/>`__ - a password manager |
| 127 |
* `Setzer <https://www.cvfosammmm.org/setzer/>`__ - a LaTeX editor |
| 128 |
* `Terminator <https://gnome-terminator.org/>`__ - The Robot Future of Terminals |
| 129 |
* `Wike <https://hugolabe.github.io/Wike/>`__ - a Wikipedia reader |
| 130 |
|
| 131 |
|
| 132 |
The following applications or libraries use PyGObject for optional features, |
| 133 |
such as plugins or as optional backends: |
| 134 |
|
| 135 |
* `beets <https://beets.io/>`__ - a music library manager and MusicBrainz tagger |
| 136 |
* `gedit <https://wiki.gnome.org/Apps/Gedit>`__ - a GNOME text editor |
| 137 |
* `matplotlib <https://matplotlib.org/>`__ - a python 2D plotting library |
| 138 |
* `Totem <https://wiki.gnome.org/Apps/Videos>`__ - a video player for GNOME |
| 139 |
|
| 140 |
Further Resources |
| 141 |
----------------- |
| 142 |
|
| 143 |
`GNOME Developer Documentation <https://developer.gnome.org/documentation/tutorials/beginners.html>`__ |
| 144 |
Tutorials for creating a GNOME application using PyGObject, GTK 4, and Libadwaita. |
| 145 |
|
| 146 |
`GNOME Python API documentation <https://api.pygobject.gnome.org/>`__ |
| 147 |
Auto generated API documentation for many libraries accessible through |
| 148 |
PyGObject. |