python-async-patterns
Python asyncio patterns for concurrent programming. Triggers on: asyncio, async, await, coroutine, gather, semaphore, TaskGroup, event loop, aiohttp, concurrent.
Install / Use
npx skills add aiskillstore/marketplace --skill python-async-patternsInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
Our assessment of python-async-patterns
python-async-patterns scores 87/100 on our quality scale, 2237th of 4,717 Development & Engineering skills we index (top 48%).
Its SKILL.md is 4.2 KB long, well organised into 19 sections with 8 code examples: a solid amount of guidance for an agent.
It has 428 GitHub stars, a meaningful sign that others use it.
Maintenance, license and trust
- The repository was last updated about 2 months ago, so python-async-patterns is actively maintained.
- Our last check on 2026-11-02 found the source still online.
- No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
- Its trust signals score 88/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-10-07. Automated pattern scan on 2026-10-07. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
python-async-patterns compared with similar skills
All 4 of these similar skills score higher than python-async-patterns; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| python-async-patterns (this skill)by aiskillstore | 87 | 428 | 55d ago | SKILL.md |
| taste-skillby Leonxlnx | 100 | 118.3k | 10d ago | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 113.0k | 10d ago | CLAUDE.md |
| hyperframesby heygen-com | 100 | 86.4k | today | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 80.1k | today | CLAUDE.md |
Frequently asked questions
- How do I install python-async-patterns?
- Run
npx skills add aiskillstore/marketplace --skill python-async-patterns. The install tabs above show the steps for each supported agent. - Which AI agents does python-async-patterns work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is python-async-patterns safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It declares no license and scores 88/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is python-async-patterns still maintained?
- The repository was last updated about 2 months ago, so python-async-patterns is actively maintained.
Skill content
View source on GitHubname: python-async-patterns description: "Python asyncio patterns for concurrent programming. Triggers on: asyncio, async, await, coroutine, gather, semaphore, TaskGroup, event loop, aiohttp, concurrent." compatibility: "Python 3.10+ recommended. Some patterns require 3.11+ (TaskGroup, timeout)." allowed-tools: "Read Write" depends-on: [python-typing-patterns] related-skills: [python-fastapi-patterns, python-observability-patterns]
Python Async Patterns
Asyncio patterns for concurrent Python programming.
Core Concepts
import asyncio
# Coroutine (must be awaited)
async def fetch(url: str) -> str:
async with aiohttp.ClientSession() as session:
async with session.get(url) as response:
return await response.text()
# Entry point
async def main():
result = await fetch("https://example.com")
return result
asyncio.run(main())
Pattern 1: Concurrent with gather
async def fetch_all(urls: list[str]) -> list[str]:
"""Fetch multiple URLs concurrently."""
async with aiohttp.ClientSession() as session:
tasks = [fetch_one(session, url) for url in urls]
return await asyncio.gather(*tasks, return_exceptions=True)
Pattern 2: Bounded Concurrency
async def fetch_with_limit(urls: list[str], limit: int = 10):
"""Limit concurrent requests."""
semaphore = asyncio.Semaphore(limit)
async def bounded_fetch(url):
async with semaphore:
return await fetch_one(url)
return await asyncio.gather(*[bounded_fetch(url) for url in urls])
Pattern 3: TaskGroup (Python 3.11+)
async def process_items(items):
"""Structured concurrency with automatic cleanup."""
async with asyncio.TaskGroup() as tg:
for item in items:
tg.create_task(process_one(item))
# All tasks complete here, or exception raised
Pattern 4: Timeout
async def with_timeout():
try:
async with asyncio.timeout(5.0): # Python 3.11+
result = await slow_operation()
except asyncio.TimeoutError:
result = None
return result
Critical Warnings
# WRONG - blocks event loop
async def bad():
time.sleep(5) # Never use time.sleep!
requests.get(url) # Blocking I/O!
# CORRECT
async def good():
await asyncio.sleep(5)
async with aiohttp.ClientSession() as s:
await s.get(url)
# WRONG - orphaned task
async def bad():
asyncio.create_task(work()) # May be garbage collected!
# CORRECT - keep reference
async def good():
task = asyncio.create_task(work())
await task
Quick Reference
| Pattern | Use Case |
|---------|----------|
| gather(*tasks) | Multiple independent operations |
| Semaphore(n) | Rate limiting, resource constraints |
| TaskGroup() | Structured concurrency (3.11+) |
| Queue() | Producer-consumer |
| timeout(s) | Timeout wrapper (3.11+) |
| Lock() | Shared mutable state |
Async Context Manager
from contextlib import asynccontextmanager
@asynccontextmanager
async def managed_connection():
conn = await create_connection()
try:
yield conn
finally:
await conn.close()
Additional Resources
For detailed patterns, load:
./references/concurrency-patterns.md- Queue, Lock, producer-consumer./references/aiohttp-patterns.md- HTTP client/server patterns./references/mixing-sync-async.md- run_in_executor, thread pools./references/debugging-async.md- Debug mode, profiling, finding issues./references/production-patterns.md- Graceful shutdown, health checks, signal handling./references/error-handling.md- Retry with backoff, circuit breakers, partial failures./references/performance.md- uvloop, connection pooling, buffer sizing
Scripts
./scripts/find-blocking-calls.sh- Scan code for blocking calls in async functions
Assets
./assets/async-project-template.py- Production-ready async app skeleton
See Also
Prerequisites:
python-typing-patterns- Type hints for async functions
Related Skills:
python-fastapi-patterns- Async web APIspython-observability-patterns- Async logging and tracingpython-database-patterns- Async database access
Related Skills
taste-skill
118.3kAgent skills that give coding agents taste: art direction, reference images and a browser check instead of generic AI pages
Agent-Reach
113.0kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
hyperframes
86.4kAI video you can actually edit. HyperFrames is a free, open-source AI video editor. Describe any video and get a real project you can change down to the frame.
headroom
80.1kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
