qasync
Python library for using asyncio in Qt-based applications
What it is and what it does
qasync bridges asyncio and Qt by implementing a PEP 3156 event loop that runs inside a Qt application's main thread. This lets you write async/await code directly in PyQt/PySide event handlers and slots, replacing the need for manual threading with cleaner, more readable coroutine-based logic.
The package provides decorators like @asyncSlot and @asyncClose to mark async event handlers, and exposes run_in_executor for CPU-bound work on thread pools. It has no runtime dependencies beyond a Qt binding (PyQt5/6 or PySide2/6) and maintains active development with support for Python 3.8 and later.
Use it for:
- Build responsive Qt GUIs that fetch data from APIs without blocking the UI thread using async/await.
- Replace QThread boilerplate with cleaner asyncio patterns for background tasks in PyQt/PySide apps.
- Coordinate multiple concurrent operations (timers, I/O, network calls) within a single Qt event loop.
- Offload CPU-intensive work to thread pools via run_in_executor while keeping the UI responsive.
- Migrate existing asyncio codebases to Qt-based desktop applications without rewriting async logic.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
qasync integrates asyncio coroutines into PyQt/PySide applications by providing a PEP 3156 event loop, allowing async/await syntax directly in Qt's main thread without threading.
Yes. qasync is actively maintained, has no external dependencies, carries a permissive license, and solves a real pain point—integrating asyncio into Qt apps cleanly. The codebase is stable (Production/Stable classifier), tested across major platforms, and has seen regular updates. Install it if you're building a PyQt/PySide application and want to use async/await instead of threading.
Install
qasync on PyPI
pip
pip install qasyncuv
uv add qasyncpoetry
poetry add qasyncInstalling qasync
Before you install
Low friction: pure Python wheel with no runtime dependencies. Actively maintained as of July 2026 with 405 repository stars and a clear maintenance commitment stated in the project.
License in practice
BSD-2-Clause permissive license allows use, modification, and redistribution with minimal restrictions—suitable for both open and closed projects.
Quickstart
pip install qasync
from qasync import QApplication, QEventLoop
import asyncio
app = QApplication(sys.argv)
loop = QEventLoop(app)
asyncio.set_event_loop(loop)
# Use async functions in Qt slots and event handlers
Requires PyQt5, PyQt6, PySide2, or PySide6 to be installed separately; Python >=3.8 required.
Verify before relying
- Whether the package works with all four Qt bindings (PyQt5/6, PySide2/6) equally well or has known limitations with any.
- Performance characteristics when running CPU-intensive tasks via QThreadExecutor compared to standard threading approaches.
- Compatibility with recent Python 3.13+ versions given the stated support ceiling of <3.14.
Package facts
| License | BSD-2-Clause (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 351 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 370,908/month — #7,173 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: qasync-0.28.0-py3-none-any.whl
Keywords: Qt, asyncio
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
nest-asyncioPatches asyncio to allow nested event loops,…
permissive · top 1,000 on PyPI
QtPyQtPy provides a unified API for writing Qt…
permissive · top 5,000 on PyPI
qtmonacoEmbeds the Monaco Editor (VS Code's editor)…
unclear · top 15,000 on PyPI
PySide6PySide6 provides Python bindings to the Qt 6.0+…
copyleft · top 5,000 on PyPI
superqtProvides additional Qt widgets and UI…
permissive · top 15,000 on PyPI
nest-asyncio2Patches asyncio to allow nested event loops,…
permissive · top 1,000 on PyPI
aioprocessingProvides asyncio-compatible wrappers around…
permissive · top 15,000 on PyPI
asyncioThis package is an obsolete backport of…
permissive · top 1,000 on PyPI
syncerSyncer converts async functions to synchronous…
permissive · top 15,000 on PyPI
asyncio-atexitRegisters cleanup functions to run when an…
permissive · top 15,000 on PyPI