Registry / devops / aiocop

aiocop

JSON →
library1.1.4pypypi✓ verified 80d ago

Non-intrusive monitoring for Python asyncio and uvloop. Detects, pinpoints, and logs blocking IO and CPU calls that freeze your event loop. Current version: 1.1.4. Release cadence: irregular.

pip install aiocop
INSTALL
IMPORT
SIG · AIOCOP
A
aiocop
devopspythonv1.1.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

activate
from aiocop import activate
from aiocop import AioCop
deactivate
from aiocop import deactivate
core
from aiocop import core

Start monitoring with default block detection threshold of 100ms. Logs will be written to aiocop.log.

import asyncio from aiocop import AioCop # Initialize the monitor with default settings cop = AioCop(busy_threshold=0.1, log_file='aiocop.log') cop.start() # Starts monitoring in the background async def main(): # Your event loop code here await asyncio.sleep(1) asyncio.run(main()) cop.stop()
Debug
Known issues
gotchaAioCop must be started before any coroutines you want to monitor are awaited. If started mid-execution, it will not capture blocking calls that occurred before start().
fix
Call start() at the very beginning of your program, before any async functions are executed.
affects: >=1.0.0
gotchaOn Python 3.12+, the internal monkey-patching may conflict with watchfiles or pdb due to changes in sys.settrace/tracing. This can cause silent failures or missed detections.
fix
Set environment variable PYTHONTRACING=1 before starting Python, or use a try/except around AioCop construction.
affects: >=1.1.0
deprecatedThe async_id attribute (used in logs) is deprecated in 1.1.0+ and will be removed in the next major release. Use task_id instead.
fix
If parsing log output, switch from 'async_id' field to 'task_id'.
affects: 1.1.0 – 1.1.4
Upgrade
Version history
1.1.4latest on PyPI · released Feb 26, 2026
Audit
Dependencies
uvloopoptionalOptional: enables monitoring of uvloop instead of asyncio's default selector loop.
Agent activity
34 hits · last 30 days
node
31
OpenAI (training)
1
Resources

No resource links recorded.

aiocop — pip install aiocop · libregistry