{"id":13500070,"url":"https://github.com/pyedifice/pyedifice","last_synced_at":"2025-05-15T02:06:58.295Z","repository":{"id":49428890,"uuid":"331771396","full_name":"pyedifice/pyedifice","owner":"pyedifice","description":"Declarative GUI framework for Python and Qt","archived":false,"fork":false,"pushed_at":"2025-05-12T11:05:10.000Z","size":13577,"stargazers_count":451,"open_issues_count":37,"forks_count":16,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-12T11:25:27.141Z","etag":null,"topics":["declarative-ui","gui","model-view-update","python","qt","virtualdom"],"latest_commit_sha":null,"homepage":"https://pyedifice.github.io","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/pyedifice.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2021-01-21T22:26:21.000Z","updated_at":"2025-05-11T01:53:00.000Z","dependencies_parsed_at":"2024-01-14T15:06:50.365Z","dependency_job_id":"0b771d52-0274-4fe5-b6dc-9d4f551305ab","html_url":"https://github.com/pyedifice/pyedifice","commit_stats":{"total_commits":690,"total_committers":8,"mean_commits":86.25,"dds":0.2768115942028986,"last_synced_commit":"904c54d221bdc643baa0bb49598f87c1c11457f7"},"previous_names":["fding/pyedifice"],"tags_count":76,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyedifice%2Fpyedifice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyedifice%2Fpyedifice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyedifice%2Fpyedifice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyedifice%2Fpyedifice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyedifice","download_url":"https://codeload.github.com/pyedifice/pyedifice/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253728144,"owners_count":21954365,"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":["declarative-ui","gui","model-view-update","python","qt","virtualdom"],"created_at":"2024-07-31T22:00:50.768Z","updated_at":"2025-05-15T02:06:58.277Z","avatar_url":"https://github.com/pyedifice.png","language":"Python","readme":"\u003ch3 align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/pyedifice/pyedifice/master/docs/source/image/EdificePyramid.svg\" width=\"200\"\u003e\n\u003c/h3\u003e\n\n\u003ch1 align=center\u003eEdifice\u003cbr\u003e Declarative GUI framework for Python and Qt\u003c/h1\u003e\n\nEdifice is a Python library declarative framework for application user\ninterfaces.\n\n- Modern **declarative** UI paradigm from web development.\n- **100% Python** application development, no language inter-op.\n- A **native** Qt desktop app instead of a bundled web browser.\n- Fast iteration via **hot-reloading**.\n\nEdifice uses [PySide6](https://doc.qt.io/qtforpython-6/)\nor [PyQt6](https://www.riverbankcomputing.com/static/Docs/PyQt6/introduction.html)\nas a backend. Edifice is like\n[React](https://react.dev/), but with\nPython instead of JavaScript, and [Qt Widgets](https://doc.qt.io/qt-6/qtwidgets-index.html) instead of the HTML DOM.\n\nIf you have React experience, you’ll find Edifice easy to learn.\nEdifice has function Components, Props, and Hooks just like React.\n\n## Getting Started\n\n* **Installation**\n  ```console\n  pip install PySide6-Essentials\n  ```\n  ```console\n  pip install pyedifice\n  ```\n* **Source** published at [github.com/pyedifice/pyedifice](https://github.com/pyedifice/pyedifice)\n* **Package** published at [pypi.org/project/pyedifice](https://pypi.org/project/pyedifice)\n* **Documentation** published at [pyedifice.github.io](https://pyedifice.github.io)\n\n## Why Edifice?\n\n### Declarative\n\nMost existing GUI libraries in Python, such as Tkinter and Qt, operate imperatively.\nTo create a dynamic application using these libraries,\nyou must not only think about *what* widgets to display to the user,\nbut also *how* to issue the commands to modify the widgets.\n\nWith Edifice the developer\nneed only declare *what* is rendered,\nnot *how* the content is rendered.\n\nUser interactions update the application state, the state renders to a widget tree,\nand Edifice modifies the existing widget tree to reflect the new state.\n\nEdifice code looks like this:\n\n```python\n    number, set_number = use_state(0)\n\n    with VBoxView():\n        Button(\"Add 5\", on_click=lambda event: set_number(number+5))\n        Label(str(number))\n        if number \u003e 30 and number \u003c 70:\n            Label(\"Number is mid\")\n```\n\nThe GUI displays\na button and a label with the current value of `number`.\nClicking the button will add 5 to the `number`.\nIf the `number` is “mid” then another label will reveal that fact.\n\n### Edifice vs. Qt Quick\n\n[Qt Quick](https://doc.qt.io/qtforpython-6/PySide6/QtQuick/) is Qt’s declarative GUI framework for Qt.\n\nQt Quick programs are written in Python + the\nspecial [QML](https://doc.qt.io/qtforpython-6/overviews/qtdoc-qmlapplications.html) language + JavaScript.\n\nEdifice programs are written in Python.\n\nBecause Edifice programs are only Python, binding to the\nUI is much more straightforward.\nEdifice makes it easy to dynamically create, mutate, shuffle, and destroy sections of the UI.\nQt Quick assumes a much more static interface.\n\nQt Quick is like DOM + HTML + JavaScript, whereas Edifice is like React.\nQML and HTML are both declarative UI languages but\nthey require imperative logic in another language for dynamism.\nEdifice and React allow fully dynamic applications to be specified\ndeclaratively in one language.\n\n## How it works\n\nAn Edifice component is a render function which declares the mapping from the state to UI.\nThe state of a component is divided into **props** and **state**.\n**props** are passed to the component in the constructor,\nwhereas **state** is the component’s own internal state.\n\nChanges to **props** or **state** will trigger a re-render of the component.\nThe old and new component trees will be compared to one another,\nand a diffing algorithm will determine which components previously existed and which ones are new\n(the algorithm behaves similarly to the React diffing algorithm).\nComponents that previously existed will maintain their **state**, whereas their **props** will be updated.\nFinally, Edifice will issue the minimal update commands to update the UI.\n\n![MANUFACIA-Vision_capture1](https://github.com/user-attachments/assets/eab9ec8e-1334-4d79-ae0e-f1ecd7f8adac)\n\n## Development Tools\n\n### Dynamic hot-reload\n\nDyanamic hot-reload is very useful for fine-tuning the presentation styles\nof Elements deep within your application.\nYou can test if the margin should be *10px* or *15px* instantly without closing the app, reopening it, and waiting for everything to load.\n\n### Element Inspector\n\nSimilar to the Inspect Elements tool of a browser, the Element Inspector will\nshow you the tree of Elements in a running Edifice application, along with all of the props\nand state of the Elements.\n\n## License\nEdifice is [MIT Licensed](https://en.wikipedia.org/wiki/MIT_License).\n\nEdifice uses Qt under the hood, and both PyQt6 and PySide6 are supported. Note that PyQt6 is distributed with the *GPL* license while PySide6 is distributed\nunder the more flexible *LGPL* license.\n\nSee [PyQt vs PySide Licensing](https://www.pythonguis.com/faq/pyqt-vs-pyside/).\n\n\u003e ### Can I use PySide for commercial applications?\n\u003e Yes, and you don't need to release your source code to customers. The LGPL only requires you to release any changes you make to PySide itself.\n\n## Version History / Change Log / Release Notes\n\nSee [Release Notes](https://pyedifice.github.io/versions.html)\n(source: [versions.rst](docs/source/versions.rst))\n\n\n## Contribution\n\nContributions are welcome; please send Pull Requests! See\n[DEVELOPMENT.md](https://github.com/pyedifice/pyedifice/blob/master/DEVELOPMENT.md)\nfor development notes.\n\nWhen submitting a Pull Request, think about adding tests to [tests](tests) and\nadding a line to the **Unreleased** section of the\nchange log [versions.rst](docs/source/versions.rst).\n\n## Setuptools Build System\n\nThe *Setuptools* `pyproject.toml` specifies the package dependecies.\n\nBecause Edifice supports PySide6 and PyQt6 at the same time, neither\nare required by `dependencies`. A project which depends\non Edifice should also depend on either\n[PySide6-Essentials](https://pypi.org/project/PySide6-Essentials/)\nor\n[PySide6](https://pypi.org/project/PySide6/)\nor\n[PyQt6](https://pypi.org/project/PyQt6/).\n\nAdd an Edifice dependency to `pyproject.toml`:\n\n```\ndependencies = [\n  \"pyedifice\",\n  \"PySide6-Essentials\",\n]\n```\n\nThere are optional dependency groups provided for PySide6-Essentials and PyQt6:\n\n```\ndependencies = [\n  \"pyedifice [PySide6-Essentials]\"\n]\n```\n\nThe `requirements.txt` is generated by\n\n```console\nuv export --format requirements-txt --no-dev \u003e requirements.txt\n```\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyedifice%2Fpyedifice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyedifice%2Fpyedifice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyedifice%2Fpyedifice/lists"}