skillfed

qasync

Python library for using asyncio in Qt-based applications

qasync v0.28.0 370.9K downloads/30d#7,173 on PyPI405
Permissive license BSD-2-Clause Active released

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 qasync

uv

uv add qasync

poetry

poetry add qasync

Installing 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

Development Status :: 5 - Production/StableEnvironment :: X11 Applications :: QtIntended Audience :: DevelopersOperating System :: MacOSOperating System :: MacOS :: MacOS XOperating System :: MicrosoftOperating System :: Microsoft :: WindowsOperating System :: POSIXOperating System :: POSIX :: LinuxTopic :: Software Development :: Libraries :: Python Modules

Tags

asyncio in qt applicationspyqt async awaitpyside coroutinesqt event loop asyncioasync qt guipyqt threading alternative
qt-integrationasync-await

More Python Modules packages