Python async

From athola/claude-night-market · View interactive version

Python async is an AI agent skill from the GitHub repository athola/claude-night-market. Async Python patterns via asyncio and aiohttp for I/O-bound concurrency. Use when adding async APIs, handling concurrent I/O, or debugging async code.

How to use this skill

Skill file

Async Python Patterns

asyncio and async/await patterns for Python applications.

Quick Start

import asyncio

async def main():
    print("Hello")
    await asyncio.sleep(1)
    print("World")

asyncio.run(main())

When To Use

When NOT To Use

Modules

This skill uses progressive loading. Content is organized into focused modules:

Load specific modules based on your needs, or reference all for detailed guidance.

Exit Criteria

Troubleshooting

Common Issues

RuntimeError: no current event loop

Use asyncio.run() as the entry point. Avoid get_event_loop() in Python 3.10+.

Blocking call in async context

Move sync I/O to asyncio.to_thread() or loop.run_in_executor().

Tests hang indefinitely

Ensure pytest-asyncio is installed and test functions are decorated with @pytest.mark.asyncio.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.