mode-streaming
AsyncIO Service-based programming
What it is and what it does
Mode is a lightweight wrapper around asyncio that organizes async programs as services—classes with lifecycle hooks (on_start, on_started, on_stop) and optional background tasks. Services can depend on other services, forming a directed graph that Mode manages automatically. The library includes a Worker class that handles command-line startup, logging, signal handling, and graceful shutdown.
You define services by subclassing Service and implementing async methods for startup and shutdown logic. Services can start other services as dependencies, run background tasks with decorators like @Service.timer() or @Service.task, and optionally visualize their dependency graph. The fork was created to ensure regular releases, code quality, and support for modern Python versions (3.10–3.15, including free threading).
Use it for:
- Building daemon applications with multiple async components that need coordinated startup and shutdown.
- Organizing long-running services (caches, workers, servers) with clear lifecycle management and dependency injection.
- Running background tasks on timers or as continuous loops within a larger async application.
- Visualizing and debugging the dependency graph of a complex async system using beacons and pydot.
- Integrating asyncio-based services into a command-line tool with logging, signal handling, and remote debugging.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Mode is a minimal asyncio library that lets you build programs as composable services with lifecycle callbacks (start, stop, restart) and background tasks, organized into a dependency graph.
Yes. Mode is worth installing if you need to structure async programs around services with clear lifecycle management and dependency graphs. It has low install friction, active maintenance, permissive licensing, no known vulnerabilities, and broad Python version support. The fork's commitment to regular releases and modern Python support makes it a stable choice for new projects.
Install
mode-streaming on PyPI
pip
pip install mode-streaminguv
uv add mode-streamingpoetry
poetry add mode-streamingInstalling mode-streaming
Before you install
Low friction: pure Python wheel with only three runtime dependencies (colorlog, croniter, mypy_extensions). Actively maintained fork with recent releases and support for current Python versions (3.10–3.15, including free threading beta).
License in practice
Permissive license (BSD) with no restrictions on commercial or proprietary use.
Quickstart
pip install mode-streaming
from mode import Service, Worker
class MyService(Service):
async def on_start(self) -> None:
print('Service starting')
if __name__ == '__main__':
Worker(MyService(), loglevel='info').execute_from_commandline()
Requires Python 3.10 or later.
Verify before relying
- Whether the fork has achieved feature parity with the original Mode project beyond the stated goals (releases, code quality, Python version support).
- Performance characteristics or overhead of the service graph and lifecycle management compared to raw asyncio.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — colorlog, croniter, mypy_extensions |
| Maintenance | actively maintained — 2 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 427,422/month — #6,750 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: mode_streaming-0.7.1-py2.py3-none-any.whl
Keywords: asyncio, service, bootsteps, graph, coroutine
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
aioprocessingProvides asyncio-compatible wrappers around…
permissive · top 15,000 on PyPI
geventgevent provides lightweight concurrent…
permissive · top 1,000 on PyPI
eventletEventlet provides concurrent network…
permissive · top 5,000 on PyPI
greenletGreenlet provides lightweight coroutines for…
permissive · top 100 on PyPI
tornadoTornado is a Python web framework and…
permissive · top 1,000 on PyPI
asyncio-poolManages a pool of concurrent asyncio…
permissive · top 15,000 on PyPI
threadloopRuns Tornado coroutines from synchronous Python…
permissive · top 15,000 on PyPI
aiomultiprocessCombines AsyncIO and multiprocessing to run…
permissive · top 5,000 on PyPI
mozrunnerMozrunner manages the lifecycle of Mozilla…
copyleft · top 15,000 on PyPI
aiologicaiologic provides thread-aware and async-aware…
permissive · top 5,000 on PyPI