Skip to main content

trio-vis

trio-vis is a plugin for visualizing the scope history of your Trio project.

showcase

How to use

  1. Install trio-vis via pip install trio-vis (trio-vis-pip)

  2. In your source code, register SC_Monitor() as an Instrument while running trio

    from trio_vis import SC_Monitor
    trio.run(my_main_funciton, instruments=[SC_Monitor()])
    
  3. After your program finished(or exited), the scope history would be stored in ./sc-logs.json

  4. Upload your log file to sc-visualiver, this is a twin project which focuses on visualization work.

  5. See your visualization result and help us improve.

Configuration

Import VisConfig from trio_vis, and provide it as an argument while making your SC_Monitor object.

from trio_vis import SC_Monitor, VisConfig
cfg = VisConfig(print_task_tree=True)
trio.run(my_main_funciton, instruments=[SC_Monitor(config=cfg)])

What does it do

trio-vis utilize the Instrument API to monitor the lifetime of scopes (Task,Nursery). Since the Instrument API doesn't provide callbacks for Nursery, we make inferences on our own.

Why visualize

Derived from curio, trio combines the idea of Structured Concurrency with existing single-threaded event-driven architecture. Which does make concurrent programs more manageable.

To make trio comparable with curio, contributors of trio also want to mimic the feature of curio-monitor to monitor the current system running state. This idea could be traced back to trio-issue-413.

Since then, projects have been developed (shown below).

However, trio is not curio, at least lifetimes of scopes are structured by nature. I argue that by utilizing the feature of Structured Concurrency, we could visualize programs better. Developers could easily conceptualize their program, and bring their developing experience to the next level.

Previous work

Future plan

This project is in an early developing stage. Stay tuned for future update.

Metadata

Release files for trio-vis 0.0.1

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

Source distribution (sdist)

Source distribution for trio-vis 0.0.1
File Size Uploaded
trio-vis-0.0.1.tar.gz 12.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for trio-vis 0.0.1
File Interpreter ABI Platform
trio_vis-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 24.5 kB

Release files / trio-vis-0.0.1.tar.gz

Download URL trio-vis-0.0.1.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a4ba1cb30bdb7a379570d1948c959405f406c4d0707cf7df94bb975c2b880fa7
BLAKE2b-256 checksum
How to use checksums
f976b462711b09cc46a740b4246cc4a3590cccf0f0fa4e0a91491db2cf547681
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.7 CPython/3.8.3 Darwin/20.5.0

Release files / trio_vis-0.0.1-py3-none-any.whl

Download URL trio_vis-0.0.1-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2cd94ffa22880210ef8af6aeaa1c9c7ece4606793de839cd721400fea532a391
BLAKE2b-256 checksum
How to use checksums
ee4ba6da0ae484f0304ffa487ffc08230356623fd4f0ddeed38addee053a009c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.7 CPython/3.8.3 Darwin/20.5.0

Release history Release notifications | RSS feed

0.1.0

2 release files

This release

0.0.1 This release

2 release files

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