{"id":14064782,"url":"https://github.com/ObaraEmmanuel/Formation","last_synced_at":"2025-07-29T19:31:20.510Z","repository":{"id":38263083,"uuid":"202930437","full_name":"ObaraEmmanuel/Formation","owner":"ObaraEmmanuel","description":"Tools for building gorgeous graphical user interfaces in tkinter","archived":false,"fork":false,"pushed_at":"2024-11-19T17:27:36.000Z","size":6155,"stargazers_count":280,"open_issues_count":8,"forks_count":24,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-11-19T18:37:40.274Z","etag":null,"topics":["formation-studio","gui","python","tix","tk","tkinter","ttk","ui"],"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/ObaraEmmanuel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-17T20:53:38.000Z","updated_at":"2024-11-19T18:06:33.000Z","dependencies_parsed_at":"2022-09-02T11:01:40.007Z","dependency_job_id":"833d11fa-dd55-4db4-8911-1d2b2c03c20a","html_url":"https://github.com/ObaraEmmanuel/Formation","commit_stats":{"total_commits":419,"total_committers":7,"mean_commits":"59.857142857142854","dds":"0.13126491646778038","last_synced_commit":"d45ce24fc8860efb46bbf624a29ac96631c6f5d9"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ObaraEmmanuel%2FFormation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ObaraEmmanuel%2FFormation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ObaraEmmanuel%2FFormation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ObaraEmmanuel%2FFormation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ObaraEmmanuel","download_url":"https://codeload.github.com/ObaraEmmanuel/Formation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228040849,"owners_count":17860211,"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":["formation-studio","gui","python","tix","tk","tkinter","ttk","ui"],"created_at":"2024-08-13T07:04:04.623Z","updated_at":"2025-07-29T19:31:20.478Z","avatar_url":"https://github.com/ObaraEmmanuel.png","language":"Python","funding_links":[],"categories":["Python","GUI Designers"],"sub_categories":[],"readme":"![Formation logo](https://raw.githubusercontent.com/obaraemmanuel/Formation/master/docs/_static/logo.png)\n\n![license](https://img.shields.io/github/license/ObaraEmmanuel/Formation)\n![tests](https://github.com/ObaraEmmanuel/Formation/workflows/build/badge.svg)\n[![pypi version](https://img.shields.io/pypi/v/formation-studio.svg)](https://pypi.org/project/formation-studio/)\n![python version](https://img.shields.io/badge/python-3.9+-blue.svg)\n![platforms](https://img.shields.io/badge/Platforms-Linux%20|%20Windows%20|%20Mac%20-purple.svg)\n[![Documentation Status](https://readthedocs.org/projects/formation-studio/badge/?version=latest)](https://formation-studio.readthedocs.io/en/latest/?badge=latest)\n## Introduction\n\n**Formation studio** is a tool that makes developing user interfaces in Python a breeze. By generating the interface code from simple drag-and-drop widgets, it allows developers to focus\non building product functionality and beautiful designs. Formation Studio has a set of powerful tools which can be used to design interfaces saved in\n[.XML](https://en.wikipedia.org/wiki/XML) or [.JSON](https://en.wikipedia.org/wiki/JSON) files. These generated files can then be loaded in code. Formation Studio draws inspiration from other\n[RAD](https://en.wikipedia.org/wiki/Rapid_application_development) tools such as\n[Android Studio's](https://developer.android.com/studio) visual layout editor,\n[PAGE](http://page.sourceforge.net). \n\nThe design below was built solely in Formation Studio (no images or external tools).\n\n![Formation demo](https://raw.githubusercontent.com/obaraemmanuel/Formation/master/docs/_static/canvas-full-demo.png)\n\n## Getting started\n\n### Installation\n\nTo use Formation Studio, [install Python 3.9 or higher](https://www.python.org/downloads/)\n\nAfterwards, install Formation Studio with pip (Python package manager).\n\n```bash\npip install formation-studio\n```\n\nThe development branch can be installed with the following command:\n\u003e **note**: Git needs to be installed to use the following command, and the above version of Formation Studio should be installed prior\n\n```bash\npip install --upgrade git+https://github.com/obaraemmanuel/Formation@master\n```\n\n### Installation on Linux\n\nFormation Studio uses TKinter and, depending on the distribution/platform, it may not be installed by default. If TKinter is not installed, install `tkinter` and `imagetk` after installing Formation Studio.\n\nInstall command for `tkinter` and `imagetk` on Debian Python:\n\n```bash\nsudo apt-get install python3-tk, python3-pil.imagetk\n```\n\n\u003e Note: The above instruction is only assured to work on Ubuntu. For\n\u003e other versions, change the installation command based on the platform. Also, ensure these commands install to the correct directory if multiple versions of python exist on the machine. Formation Studio is a Python 3 application, therefore it does not support Python 2.\n\n### Launching\n\nAfter installation, you can launch Formation Studio from the command line using the command\n\n```bash\nformation-studio\n```\n\n\u003e Note: Multiple instances of Formation Studio will not work simultaneously.\n\nThe studio will open a blank design by default (This can be changed in the preferences). With detachable tool windows, Formation Studio is able to provide the flexibility to tailor to every developer's unique needs.\n\nMultiple design files can be opened in different tabs.\n\n![Formation window](https://raw.githubusercontent.com/obaraemmanuel/Formation/master/docs/_static/showcase.png)\n*Demonstration of Formation Studio above ^*\n\nWidgets can be selected from the _**Components**_ pane at the top to be dragged on stage. Click to select widgets\non the workspace and customize them on _**Stylepane**_ to the right. The widget hierarchies can be viewed from the _**\nComponent tree**_ at the bottom left. To preview the design, use the preview (\"run button\") on the toolbar. The design can be saved in the top bar by going to _File \u003e Save_. Below is a sample studio preview saved\nas `hello.xml`\n\n\u003cp align=\"center\"\u003e\n    \u003cimg alt=\"sample design\" src=\"https://raw.githubusercontent.com/obaraemmanuel/Formation/master/docs/_static/hello.png\"/\u003e\n\u003c/p\u003e\n\nThe underlying xml uses namespaces as shown below:\n\n```xml\n\u003ctkinter.Frame \n    xmlns:attr=\"http://www.hoversetformationstudio.com/styles/\" \n    xmlns:layout=\"http://www.hoversetformationstudio.com/layouts/\" \n    name=\"Frame_1\" \n    attr:layout=\"place\" \n    layout:width=\"616\" \n    layout:height=\"287\" \n    layout:x=\"33\" \n    layout:y=\"33\"\u003e\n    \u003ctkinter.ttk.Label \n        name=\"myLabel\" \n        attr:foreground=\"#44c33c\" \n        attr:font=\"{Calibri} 20 {}\" \n        attr:anchor=\"center\" attr:text=\"Hello World!\" \n        layout:width=\"539\" \n        layout:height=\"89\" \n        layout:x=\"41\" \n        layout:y=\"41\"/\u003e\n    \u003ctkinter.ttk.Button \n        name=\"myButton\"\n        attr:command=\"on_click\"\n        attr:text=\"Click me\" \n        layout:width=\"95\" \n        layout:height=\"30\" \n        layout:x=\"266\" \n        layout:y=\"204\"/\u003e\n\u003c/tkinter.Frame\u003e\n\n```\n\n\u003e Note: this xml file has been manually formatted to make it more legible. The actual xml file\n\u003e will not be formatted as the developer is not expected to change it manually.\n\nTo load the design in your python code is as simple as:\n\n```python\n# import the formation library which loads the design for you\nfrom formation import AppBuilder\n\ndef on_click(event):\n    print(\"Button clicked\")\n\napp = AppBuilder(path=\"hello.xml\")\n\napp.connect_callbacks(globals()) # clicking the button will trigger the on_click function\n\nprint(app.myLabel[\"text\"]) # outputs text in the label 'Hello world!'\nprint(app.myButton[\"text\"]) # outputs text in the button 'Click me'\n\napp.mainloop()\n```\n\n\u003eNote: Its advisable that widget names are valid Python identifiers (starting with underscores/letters, not having special letters, and not being a [reserved keyword](https://www.programiz.com/python-programming/keyword-list)) to avoid \n\u003epossible issues at runtime.\n\u003eUse the widget's exact name as specified in the design to avoid `AttributeError`\n\n### formation CLI\nFormation also features a CLI to help do certain operations outside the studio such\nas install updates and modify or delete config files. The CLI is however more\nuseful for Formation Studio developers. To run the CLI use the command `formation-cli`.\n\n```bash\nformation-cli --help\n```\n\n```\nusage: formation-cli [-h] [-r FILES] [-c KEY [VALUES ...]] [-u] [-v]\n\nCommand line tools for formation studio\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -r FILES, --remove FILES\n                        Removes and cleans internal app files. Can be set to config, cache or all.\n  -c KEY [VALUES ...], --config KEY [VALUES ...]\n                        Get or set studio configuration values.\n  -u, --upgrade         Upgrade formation studio to latest version\n  -v, --version         show program's version number and exit\n```\n\n### Formation Debugger\nFormation debugger is a tool that lets you inspect, modify or debug widgets in a running Tkinter application in real-time. \nYou can adjust widget attributes and layouts using an intuitive debugger UI.\nIt also features a console that can be used to interact with your running application.\n\nTo use the debugger run your python app using the `formation-dbg` command.\n\n```bash\nformation-dbg /path/to/myapp.py\n```\nThe debugger will automatically attach to the running application as shown below:\n\n![Formation Debugger](https://raw.githubusercontent.com/obaraemmanuel/Formation/master/docs/_static/debugger.png)\n\nYou can then use the pointer icon to select any widget in your running app and inspect or modify its properties/layout.\nThe console is a standard Python REPL. There is a minimal debugger interface that allows you to access the currently\nselected widget in the console. Below is a demonstration of this interface:\n\n```python\n# get the currently selected widget\nwidget = debugger.selected\n\n# when multiple widgets are selected\n# this will return a list of the widgets\nwidgets = debugger.selection\n\n# get the root widget\nroot = debugger.root\n```\nThe returned widget will be the actual tk widget running in your application, so you can call any method or access any attribute\n\n-----------------------------\n    \nFor more details checkout the [documentation](https://formation-studio.readthedocs.io/en/latest/)\nFor those wishing to contribute, see the [studio notes](https://formation-studio.readthedocs.io/en/latest/studio/architecture.html) for developers and contributors\nSome good documentation for building Python user interfaces\ninclude:\n\n- [TkDocs](http://www.tkdocs.com)\n- [Graphical User Interfaces with Tk](http://docs.python.org/3.5/library/tk.html)\n- [An Introduction to Tkinter](https://web.archive.org/web/20170518202115/http://effbot.org/tkinterbook/tkinter-index.htm)\n- [Tcl/Tk 8.5 Manual](http://www.tcl.tk/man/tcl8.5/) \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FObaraEmmanuel%2FFormation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FObaraEmmanuel%2FFormation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FObaraEmmanuel%2FFormation/lists"}