--- id: aiorun version: "2025.1.1" license: unclear license_treatment: permissive maintenance: active --- # aiorun — Boilerplate for asyncio applications License: permissive · Maintenance: active · Downloads: 313.0K/mo ## What it is and what it does aiorun is a lightweight wrapper around asyncio that eliminates boilerplate for long-lived async applications. Instead of manually creating event loops, scheduling tasks, setting up signal handlers, and orchestrating graceful shutdown, you pass a coroutine to aiorun.run() and it handles the rest—creating the loop, running forever, catching SIGINT and SIGTERM, cancelling pending tasks, and closing cleanly. The package is designed for servers and daemon-like applications that should keep running until explicitly stopped. Unlike the standard library's asyncio.run(), which exits when the coroutine completes, aiorun.run() runs indefinitely unless you call loop.stop() or an unhandled exception occurs (if stop_on_unhandled_errors=True is set). It automatically gathers and cancels all pending tasks during shutdown, waits for executor jobs to finish, and closes the event loop. Use it for: - Building a TCP or HTTP server that needs clean signal handling and task cancellation on shutdown. - Running a long-lived async daemon or background worker that should survive transient errors. - Simplifying asyncio application startup when you want to avoid writing shutdown boilerplate. - Creating a resilient API service where one endpoint's exception shouldn't crash the entire process. - Prototyping async applications quickly without manually managing event loop lifecycle. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a simplified entry point for asyncio applications that handles event loop setup, signal handling, task cancellation, and graceful shutdown automatically. Yes, if you are building asyncio-based servers or long-lived applications. The package eliminates common shutdown-sequence bugs and is actively maintained with zero known vulnerabilities. Install friction is minimal (no dependencies, pure Python). The only caveat: read the documentation carefully—aiorun.run() behaves differently from asyncio.run() (runs forever by default), which can surprise developers expecting standard library semantics. ## Install pip install aiorun uv add aiorun poetry add aiorun ## Installing aiorun Before you install: Low friction—pure Python, no runtime dependencies, and actively maintained with recent releases. Last commit was 2026-08-10 and the package supports current Python versions (3.8 through 3.12). License in practice: Permissive license treatment means you can use this in commercial and proprietary projects without restrictive obligations. Quickstart: import asyncio from aiorun import run async def main(): await asyncio.sleep(1.0) if __name__ == '__main__': run(main()) Requires Python 3.7 or later. Note that aiorun.run() runs forever by default—call loop.stop() inside your coroutine to exit, or pass stop_on_unhandled_errors=True to crash on exceptions. Verify before relying: - Whether the package's signal handling behavior (SIGINT, SIGTERM) is portable across Windows and Unix-like systems. - Performance characteristics when managing many concurrent tasks during shutdown. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 313.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags asyncio application boilerplate, asyncio event loop runner, graceful shutdown asyncio, signal handling async python, asyncio task cancellation, long-running async server, asyncio startup shutdown, asyncio, server-boilerplate [View on SkillFed](https://skillfed.io/packages/aiorun) · [View on PyPI](https://pypi.org/project/aiorun/)