Skip to main content

Python application Pypi version Downloads codecov

aio-live-tasks-exceptions

Trace python asyncio tasks exceptions live!

Installation

Install the last released version using pip:

python3 -m pip install -U aio-live-task-traces

Or install the latest version from sources:

git clone git@github.com:matan1008/aio-live-task-traces.git
cd aio-live-task-traces
python3 -m pip install -U -e .

Usage

Usually, if you run a task that throws exception using asyncio you will not be aware of the exception until the task is awaited or deleted. For example:

import asyncio


async def faulty_task():
    raise Exception('foo')


async def main():
    task = asyncio.create_task(faulty_task())
    await asyncio.sleep(3600)
    await task

    
if __name__ == '__main__':
    # The exception will be printed after 3600 seconds
    asyncio.run(main())

This package, will wrap each task you run so the exception will be traced the moment it raises:

import asyncio
from aio_live_task_traces import set_live_task_traces


async def faulty_task():
    raise Exception('foo')


async def main():
    set_live_task_traces(True)
    task = asyncio.create_task(faulty_task())
    await asyncio.sleep(3600)
    await task

    
if __name__ == '__main__':
    # The exception will be printed both immediately and after 3600 seconds
    asyncio.run(main())

Metadata

Release files for aio-live-task-traces 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aio-live-task-traces 0.0.2
File Size Uploaded Provenance
aio_live_task_traces-0.0.2.tar.gz 40.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for aio-live-task-traces 0.0.2
File Interpreter ABI Platform
aio_live_task_traces-0.0.2-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 68.8 kB

Release files / aio_live_task_traces-0.0.2.tar.gz

Download URL aio_live_task_traces-0.0.2.tar.gz
Size 40.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b115cc6ba190891f517f7e2ed3c24479e744ff50a8c3607907a4058d1c24c315
BLAKE2b-256 checksum
How to use checksums
8be4eeb76d002b9a3d445500b554a4d3951bfd537e9e8e27478e1c4db05713a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / aio_live_task_traces-0.0.2-py2.py3-none-any.whl

Download URL aio_live_task_traces-0.0.2-py2.py3-none-any.whl
Size 28.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
5aa1843a6acdbf13bd1907f7e9d73e9d98007650e6c51c65fef7dec96b3a450f
BLAKE2b-256 checksum
How to use checksums
1e78d479839fa98f56f0c6a9b0f27a902b7f750bd9f90cce2e884a5e25d83976
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Security for aio-live-task-traces 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page