--- id: mode-streaming version: "0.7.1" license: unclear license_treatment: permissive maintenance: active --- # mode-streaming — AsyncIO Service-based programming License: permissive · Maintenance: active · Downloads: 427.4K/mo ## 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 above — 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 pip install mode-streaming uv add mode-streaming 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_current - Install friction: low - Maintenance: active - Downloads: 427.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags asyncio service framework, async service lifecycle management, asyncio background tasks, service dependency graph, asyncio worker pattern, async service orchestration, coroutine lifecycle management, asyncio-framework, service-lifecycle, dependency-injection [View on SkillFed](https://skillfed.io/packages/mode-streaming) · [View on PyPI](https://pypi.org/project/mode-streaming/)