{"id":13502166,"url":"https://github.com/alejandroautalan/pygubu","last_synced_at":"2025-05-13T17:05:54.143Z","repository":{"id":6919401,"uuid":"8170146","full_name":"alejandroautalan/pygubu","owner":"alejandroautalan","description":"A simple GUI builder for the python tkinter module","archived":false,"fork":false,"pushed_at":"2025-03-24T06:06:02.000Z","size":2701,"stargazers_count":2114,"open_issues_count":13,"forks_count":216,"subscribers_count":91,"default_branch":"master","last_synced_at":"2025-04-23T23:17:30.204Z","etag":null,"topics":["gui","python","tkinter"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alejandroautalan.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":["https://paypal.me/AlejandroA36"]}},"created_at":"2013-02-13T00:02:24.000Z","updated_at":"2025-04-23T11:19:41.000Z","dependencies_parsed_at":"2024-02-25T05:26:50.674Z","dependency_job_id":"cc383da5-cf49-4a0e-8b69-182b51c3b720","html_url":"https://github.com/alejandroautalan/pygubu","commit_stats":{"total_commits":780,"total_committers":29,"mean_commits":"26.896551724137932","dds":0.07948717948717954,"last_synced_commit":"7914476dd8a0ea0f22a213dcde9c17257d9e6d65"},"previous_names":[],"tags_count":67,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alejandroautalan%2Fpygubu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alejandroautalan%2Fpygubu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alejandroautalan%2Fpygubu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alejandroautalan%2Fpygubu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alejandroautalan","download_url":"https://codeload.github.com/alejandroautalan/pygubu/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250528902,"owners_count":21445519,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gui","python","tkinter"],"created_at":"2024-07-31T22:02:04.405Z","updated_at":"2025-04-23T23:17:39.406Z","avatar_url":"https://github.com/alejandroautalan.png","language":"Python","readme":"[![Build Status](https://travis-ci.org/alejandroautalan/pygubu.svg?branch=master)](https://travis-ci.org/alejandroautalan/pygubu)\n\n[Leer en Español](LEEME.md)\n\nWelcome to Pygubu!\n==================\n\n`Pygubu` is a [RAD tool](https://en.wikipedia.org/wiki/Rapid_application_development) to enable _quick_ and _easy development of user interfaces_ for the Python's `tkinter` module.\n\nThe user interfaces designed are saved as [XML](https://en.wikipedia.org/wiki/XML) files, and, by using the _pygubu builder_, these can be loaded by applications dynamically as needed.\n\nPygubu is inspired by [Glade](https://gitlab.gnome.org/GNOME/glade).\n\nInstallation\n============\n\nThe latest version of pygubu requires Python \u003e= 3.8\n\nYou can install pygubu using pip:\n\n```\npip install pygubu\n```\n\nUsage\n=====\n\nSince version 0.10 the project was splitted in two main modules:\n\n- The **pygubu core** (this project), that load and build user interfaces defined in xml.\n- The **interface editor** [pygubu-designer](https://github.com/alejandroautalan/pygubu-designer), that helps you create the xml definition graphically.\n\nStart creating your tkinter application xml UI definition using the pygubu-designer editor.\n\nThe following is a UI definition example called [helloworld.ui](https://github.com/alejandroautalan/pygubu-designer/blob/master/examples/helloworld/helloworld.ui):\n\n\n```xml\n\u003c?xml version='1.0' encoding='utf-8'?\u003e\n\u003cinterface version=\"1.2\"\u003e\n  \u003cobject class=\"tk.Toplevel\" id=\"mainwindow\"\u003e\n    \u003cproperty name=\"height\"\u003e200\u003c/property\u003e\n    \u003cproperty name=\"resizable\"\u003eboth\u003c/property\u003e\n    \u003cproperty name=\"title\" translatable=\"yes\"\u003eHello World App\u003c/property\u003e\n    \u003cproperty name=\"width\"\u003e200\u003c/property\u003e\n    \u003cchild\u003e\n      \u003cobject class=\"ttk.Frame\" id=\"mainframe\"\u003e\n        \u003cproperty name=\"height\"\u003e200\u003c/property\u003e\n        \u003cproperty name=\"padding\"\u003e20\u003c/property\u003e\n        \u003cproperty name=\"width\"\u003e200\u003c/property\u003e\n        \u003clayout manager=\"pack\"\u003e\n          \u003cproperty name=\"expand\"\u003etrue\u003c/property\u003e\n          \u003cproperty name=\"side\"\u003etop\u003c/property\u003e\n        \u003c/layout\u003e\n        \u003cchild\u003e\n          \u003cobject class=\"ttk.Label\" id=\"label1\"\u003e\n            \u003cproperty name=\"anchor\"\u003ecenter\u003c/property\u003e\n            \u003cproperty name=\"font\"\u003eHelvetica 26\u003c/property\u003e\n            \u003cproperty name=\"foreground\"\u003e#0000b8\u003c/property\u003e\n            \u003cproperty name=\"text\" translatable=\"yes\"\u003eHello World !\u003c/property\u003e\n            \u003clayout manager=\"pack\"\u003e\n              \u003cproperty name=\"side\"\u003etop\u003c/property\u003e\n            \u003c/layout\u003e\n          \u003c/object\u003e\n        \u003c/child\u003e\n      \u003c/object\u003e\n    \u003c/child\u003e\n  \u003c/object\u003e\n\u003c/interface\u003e\n```\n\nThen, you should create your _application script_ as shown below ([helloworld.py](https://github.com/alejandroautalan/pygubu-designer/blob/master/examples/helloworld/helloworld.py)):\n\n```python\n# helloworld.py\nimport pathlib\nimport tkinter as tk\nimport tkinter.ttk as ttk\nimport pygubu\n\nPROJECT_PATH = pathlib.Path(__file__).parent\nPROJECT_UI = PROJECT_PATH / \"helloworld.ui\"\n\n\nclass HelloworldApp:\n    def __init__(self, master=None):\n        # 1: Create a builder and setup resources path (if you have images)\n        self.builder = builder = pygubu.Builder()\n        builder.add_resource_path(PROJECT_PATH)\n\n        # 2: Load a ui file\n        builder.add_from_file(PROJECT_UI)\n\n        # 3: Create the mainwindow\n        self.mainwindow = builder.get_object('mainwindow', master)\n\n        # 4: Connect callbacks\n        builder.connect_callbacks(self)\n\n    def run(self):\n        self.mainwindow.mainloop()\n\n\nif __name__ == '__main__':\n    app = HelloworldApp()\n    app.run()\n\n```\n\nNote: instead of `helloworld.ui`, you should insert the _filename_ (or full path) of your UI definition:\n\n```python\nPROJECT_UI = PROJECT_PATH / \"helloworld.ui\"\n```\n\nNote: instead of 'mainwindow', you should have the name of your _main_widget_ (the parent of all widgets) in the following line:\n\n```python\nself.mainwindow = builder.get_object('_your_main_widget_')\n```\n\nDocumentation\n=============\n\nVisit the [pygubu wiki](https://github.com/alejandroautalan/pygubu/wiki) for more documentation.\n\n\nThe following are some good tkinter (and tk) references:\n\n- [TkDocs](http://www.tkdocs.com)\n- [Graphical User Interfaces with Tk](https://docs.python.org/3/library/tk.html)\n- [Tkinter 8.5 reference: a GUI for Python](https://tkdocs.com/shipman)\n- [An Introduction to Tkinter](http://effbot.org/tkinterbook) [(archive)](http://web.archive.org/web/20200504141939/http://www.effbot.org/tkinterbook)\n- [Tcl/Tk 8.5 Manual](http://www.tcl.tk/man/tcl8.5/)\n\n\nYou can also see the [examples](https://github.com/alejandroautalan/pygubu-designer/tree/master/examples) directory or watch [this introductory video tutorial](http://youtu.be/wuzV9P8geDg).\n\n\nHistory\n=======\n\nSee the list of changes [here](HISTORY.md).\n","funding_links":["https://paypal.me/AlejandroA36"],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falejandroautalan%2Fpygubu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falejandroautalan%2Fpygubu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falejandroautalan%2Fpygubu/lists"}