$npx skillfedfor your agent

asyncio-atexit

Like atexit, but for asyncio

With conditionsPyPI Application FrameworksReleased Apr 2022671.9K downloads / moMIT LicensePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — asyncio_atexit-1.0.1-py3-none-any.whl
v1.0.1 · released 2022-04-26 · Python >=3.6

Yes, if you need event-loop-scoped cleanup in asyncio applications. Install friction is minimal and the license is permissive. The main caveat: the package has not been updated since 2022-04-26, so verify compatibility with your Python version and test that cleanup runs as expected in your specific event loop setup. No known vulnerabilities.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Must be called from within a running event loop, and cleanup only runs if the application explicitly calls loop.close()
  • Low friction: pure Python wheel with no runtime dependencies.
  • Maintenance is active with recent commits, though the package itself has not been updated since 2022-04-26.

License · maintenance · safety

MIT License (permissive) — MIT License (permissive) — you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

last release 2022-04-26 (1571 days) · last repo commit 2026-07-06 · 22 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 671,892 downloads/mo, #5,403 on PyPI

Verify before relying

pip install asyncio-atexit

import asyncio_atexit

async def cleanup():
    print('Cleaning up')

asyncio_atexit.register(cleanup)
# cleanup() runs when the event loop closes
  • Whether the package works correctly with modern Python versions beyond 3.6, given no release since 2022
  • Behavior when multiple event loops are created in the same process
  • Performance impact of the registration mechanism under high-volume cleanup scenarios
Same gist for agents: .md · .json

What it is and what it does

asyncio-atexit fills a gap in asyncio's lifecycle management by providing a way to register coroutines and synchronous functions that run when an event loop closes. The standard library's atexit module registers functions to run at interpreter shutdown, but asyncio applications often need cleanup tied to the event loop's lifecycle instead—for example, closing database connections or flushing buffers when a specific loop terminates. This package lets you register those handlers and have them called automatically.

The package accepts both async and sync functions, and they are invoked when loop.close() is called. It's a thin, focused tool: no dependencies, works with Python 3.6 and later, and integrates directly into asyncio's shutdown sequence. The main constraint is that cleanup only runs if your application explicitly closes the loop—it won't trigger on implicit cleanup or if the loop is abandoned.

Use it for

  • Close database or cache connections when an asyncio application's event loop shuts down
  • Flush pending writes or cleanup temporary resources in async server applications
  • Register teardown logic in async test fixtures that need to run after each event loop
  • Clean up external resources (files, network sockets) tied to a specific event loop instance

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you need event-loop-scoped cleanup in asyncio applications.

Install friction is minimal and the license is permissive. The main caveat: the package has not been updated since 2022-04-26, so verify compatibility with your Python version and test that cleanup runs as expected in your specific event loop setup. No known vulnerabilities.

Install

asyncio-atexit on PyPI

Before you install

Low friction: pure Python wheel with no runtime dependencies. Maintenance is active with recent commits, though the package itself has not been updated since 2022-04-26.

Must be called from within a running event loop, and cleanup only runs if the application explicitly calls loop.close()

License in practice

MIT License (permissive) — you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

Quickstart

pip install asyncio-atexit

import asyncio_atexit

async def cleanup():
    print('Cleaning up')

asyncio_atexit.register(cleanup)
# cleanup() runs when the event loop closes

Verify before relying

  • Whether the package works correctly with modern Python versions beyond 3.6, given no release since 2022
  • Behavior when multiple event loops are created in the same process
  • Performance impact of the registration mechanism under high-volume cleanup scenarios

Package facts

LicenseMIT License permissive
Python supportSupports the current Python release >=3.6
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceActively maintained 1,571 days since the last release
Last repo commit
First released
Downloads671,892 / month, #5,403 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Framework :: AsyncIOLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.6

Evidence: asyncio_atexit-1.0.1-py3-none-any.whl

Tags

Capabilities
asyncio cleanup on loop closeevent loop atexit equivalentasyncio shutdown handlersregister async cleanup functionsasyncio event loop exit callback
Topics
asynciolifecycle-management
PyPI keywords
asyncio

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “asyncio cleanup on loop close”

  • asyncio-atexitRegisters cleanup functions to run when an asyncio event loop closes,…
  • asyncioThis package is an obsolete backport of Python's asyncio module and…
  • nest-asyncio2Patches asyncio to allow nested event loops, enabling `asyncio.run()`…

Give your agent the search over MCP, or paste the wish link into any chat.

More Application Frameworks packages

fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.

MITpure Python · 3.9+
456.2Mdownloads / mo
textual Worth it
PyPI · Application Frameworks · released Jun 2026

Textual is a Python framework for building cross-platform user interfaces that run in the terminal or web browser using a modern, component-based API.

Install it if you're developing CLI tools, dashboards, or interactive terminal applications.

MITpure Python
443.6Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.

Install it if you are building CLIs in Python.

MITpure Python · 3.10+
369.3Mdownloads / mo
mcp Worth it
PyPI · Application Frameworks · released Jul 2026

Build and connect to Model Context Protocol servers that expose tools, resources, and prompts to LLM applications over stdio, HTTP, or SSE transports.

Install it if you need to build or connect to servers.

MITpure Python · 3.10+
319.3Mdownloads / mo
Werkzeug Worth it
PyPI · Application Frameworks · released Apr 2026

Werkzeug is a WSGI utility library providing request/response objects, URL routing, an interactive debugger, HTTP utilities, and a development server for building web applications.

BSD-3-Clausepure Python · 3.9+
268.1Mdownloads / mo

See also aiorun · async-exit-stack · asyncio · qasync · aioprocessing · syncer · asynctest · nest-asyncio2 · aiomultiprocess · aiosignal