{"id":18663730,"url":"https://github.com/cabbagedevelopment/qasync","last_synced_at":"2025-05-15T20:07:23.514Z","repository":{"id":35858946,"uuid":"219193663","full_name":"CabbageDevelopment/qasync","owner":"CabbageDevelopment","description":"Python library for using asyncio in Qt-based applications.","archived":false,"fork":false,"pushed_at":"2024-07-17T13:30:34.000Z","size":164,"stargazers_count":358,"open_issues_count":33,"forks_count":48,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-15T20:07:14.981Z","etag":null,"topics":["library"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CabbageDevelopment.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}},"created_at":"2019-11-02T18:05:22.000Z","updated_at":"2025-05-12T06:14:40.000Z","dependencies_parsed_at":"2023-01-16T07:45:38.348Z","dependency_job_id":"8de19348-9758-4914-9c02-c7df22cb74c6","html_url":"https://github.com/CabbageDevelopment/qasync","commit_stats":{"total_commits":103,"total_committers":25,"mean_commits":4.12,"dds":"0.49514563106796117","last_synced_commit":"e00005047e3e564e0d4757a9522bd9aff5eb960d"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CabbageDevelopment%2Fqasync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CabbageDevelopment%2Fqasync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CabbageDevelopment%2Fqasync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CabbageDevelopment%2Fqasync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CabbageDevelopment","download_url":"https://codeload.github.com/CabbageDevelopment/qasync/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254414501,"owners_count":22067272,"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":["library"],"created_at":"2024-11-07T08:19:32.755Z","updated_at":"2025-05-15T20:07:18.409Z","avatar_url":"https://github.com/CabbageDevelopment.png","language":"Python","readme":"# qasync\n\n[![Maintenance](https://img.shields.io/maintenance/yes/2023)](https://pypi.org/project/qasync)\n[![PyPI](https://img.shields.io/pypi/v/qasync)](https://pypi.org/project/qasync)\n[![PyPI - License](https://img.shields.io/pypi/l/qasync)](/LICENSE)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/qasync)](https://pypi.org/project/qasync)\n[![PyPI - Download](https://img.shields.io/pypi/dm/qasync)](https://pypi.org/project/qasync)\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/CabbageDevelopment/qasync/main.yml)](https://github.com/CabbageDevelopment/qasync/actions/workflows/main.yml)\n\n## Introduction\n\n`qasync` allows coroutines to be used in PyQt/PySide applications by providing an implementation of the `PEP 3156` event loop.\n\nWith `qasync`, you can use `asyncio` functionalities directly inside Qt app's event loop, in the main thread. Using async functions for Python tasks can be much easier and cleaner than using `threading.Thread` or `QThread`.\n\nIf you need some CPU-intensive tasks to be executed in parallel, `qasync` also got that covered, providing `QEventLoop.run_in_executor` which is functionally identical to that of `asyncio`.\n\n### Basic Example\n\n```python\nimport sys\nimport asyncio\n\nfrom qasync import QEventLoop, QApplication\nfrom PySide6.QtWidgets import QWidget, QVBoxLayout\n\nclass MainWindow(QWidget):\n    def __init__(self):\n        super().__init__()\n\n        self.setLayout(QVBoxLayout())\n        self.lbl_status = QLabel(\"Idle\", self)\n        self.layout().addWidget(self.lbl_status)\n\n    @asyncClose\n    async def closeEvent(self, event):\n        pass\n\n    @asyncSlot()\n    async def onMyEvent(self):\n        pass\n\n\nif __name__ == \"__main__\":\n    app = QApplication(sys.argv)\n\n    event_loop = QEventLoop(app)\n    asyncio.set_event_loop(event_loop)\n\n    app_close_event = asyncio.Event()\n    app.aboutToQuit.connect(app_close_event.set)\n\n    main_window = MainWindow()\n    main_window.show()\n\n    with event_loop:\n        event_loop.run_until_complete(app_close_event.wait())\n```\n\nMore detailed examples can be found [here](https://github.com/CabbageDevelopment/qasync/tree/master/examples).\n\n### The Future of `qasync`\n\n`qasync` is a fork of [asyncqt](https://github.com/gmarull/asyncqt), which is a fork of [quamash](https://github.com/harvimt/quamash). `qasync` was created because those are no longer maintained. May it live longer than its predecessors.\n\n**`qasync` will continue to be maintained, and will still be accepting pull requests.**\n\n## Requirements\n\n- Python \u003e= 3.8\n- PyQt5/PyQt6 or PySide2/PySide6\n\n`qasync` is tested on Ubuntu, Windows and MacOS.\n\nIf you need Python 3.6 or 3.7 support, use the [v0.25.0](https://github.com/CabbageDevelopment/qasync/releases/tag/v0.25.0) tag/release.\n\n## Installation\n\nTo install `qasync`, use `pip`:\n\n```\npip install qasync\n```\n\n## License\n\nYou may use, modify and redistribute this software under the terms of the [BSD License](http://opensource.org/licenses/BSD-2-Clause). See [LICENSE](/LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcabbagedevelopment%2Fqasync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcabbagedevelopment%2Fqasync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcabbagedevelopment%2Fqasync/lists"}