zthreading
A collection of wrapper classes for event broadcast and task management for python (Python Threads or Asyncio).
What it is and what it does
zthreading wraps Python's threading and asyncio primitives to provide an event-driven interface for inter-thread communication and task scheduling. It centers on an EventHandler class that lets you register listeners for named events and emit them from any thread, plus a Task class that runs functions in separate threads or async loops and also acts as an EventHandler. The package includes decorators for common patterns: running a function as a background task, batching rapid consecutive calls, and catching OS signals.
The library is designed for scenarios where you want event-based coordination between threads without manually managing locks or queues. However, it has been abandoned since mid-2022 with no commits or releases since then, so it carries the risk of incompatibility with newer Python versions and asyncio changes.
Use it for:
- Coordinate work across multiple threads using named events instead of manual queue management.
- Run a long-running function in a background thread and listen for progress events it emits.
- Batch rapid repeated calls (e.g., file saves) into fewer actual executions using the collect_consecutive_calls_async decorator.
- Gracefully handle OS signals (SIGTERM, SIGINT) in a threaded application using the catch_signal decorator.
- Stream events from a task as a Python generator, pausing the consumer until the producer emits the next event.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides event-driven communication and task management for Python threads and asyncio, with decorators for signal handling and call batching.
No. The package is abandoned (last commit 2022-06-21) with no maintenance signal. While it has low install friction and no known vulnerabilities, the lack of updates means it will likely break or behave unexpectedly on modern Python versions. For new projects, use standard library threading and asyncio primitives directly, or choose an actively maintained event library.
Install
zthreading on PyPI
pip
pip install zthreadinguv
uv add zthreadingpoetry
poetry add zthreadingInstalling zthreading
Before you install
Low install friction with no runtime dependencies. However, the package is abandoned—last release was 2022-06-13 and last commit 2022-06-21—so expect no maintenance, bug fixes, or compatibility updates.
License in practice
License file present but SPDX identifier unclear; the raw LICENSE file exists but its terms are not machine-readable from the metadata. Verify the actual license text in the repository before relying on it for commercial or copyleft-sensitive projects.
Quickstart
pip install zthreading
from zthreading.events import EventHandler
from zthreading.tasks import Task
handler = EventHandler()
handler.on("test", lambda msg: print(msg))
def work(msg):
handler.emit("test", msg)
Task(work).start("hello").join()
Requires Python 3.6 or later; package is unmaintained and may have compatibility issues with modern Python versions.
Verify before relying
- Whether the package works reliably with Python versions released after 2022-06-21 (asyncio API changes, deprecations).
- Actual license terms and SPDX identifier—metadata lists 'unclear' treatment despite LICENSE file presence.
- Whether event piping with weak references behaves correctly under garbage collection in current Python.
Package facts
| License | LICENSE (unclear) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 1,523 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 695,294/month — #5,309 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: zthreading-0.1.19-py2.py3-none-any.whl
Tags
More Application Frameworks packages
FastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
textualTextual is a Python framework for building…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
mcpBuild and connect to Model Context Protocol…
permissive · top 1,000 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
Flask-ThreadsProvides thread and thread pool helpers that…
unclear · top 5,000 on PyPI
opentelemetry-instrumentation-threadingEnsures OpenTelemetry context is propagated…
permissive · top 1,000 on PyPI
aeventkitaeventkit provides event-driven data pipelines…
permissive · top 15,000 on PyPI
pyeepyee provides an EventEmitter class for Python…
permissive · top 1,000 on PyPI
pyleakDetects leaked asyncio tasks, threads, and…
unclear · top 15,000 on PyPI
EventsProvides a publish-subscribe event system where…
permissive · top 1,000 on PyPI
kthreadKThread provides a way to forcefully terminate…
permissive · top 15,000 on PyPI
multitaskingConverts Python methods into non-blocking,…
permissive · top 1,000 on PyPI
blinkerBlinker provides a lightweight event…
permissive · top 1,000 on PyPI
eventkiteventkit provides an event-driven framework for…
permissive · top 5,000 on PyPI