skillfed

mode-streaming

AsyncIO Service-based programming

mode-streaming v0.7.1 427.4K downloads/30d#6,750 on PyPI49
Permissive license Active released

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-streaming

uv

uv add mode-streaming

poetry

poetry add mode-streaming

Installing 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

Development Status :: 5 - Production/StableEnvironment :: No Input/Output (Daemon)Framework :: AsyncIOIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIXOperating System :: UnixProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15Programming Language :: Python :: Free Threading :: 2 - BetaProgramming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Tags

asyncio service frameworkasync service lifecycle managementasyncio background tasksservice dependency graphasyncio worker patternasync service orchestrationcoroutine lifecycle management
asyncio-frameworkservice-lifecycledependency-injection

More Application Frameworks packages