Skip to main content

Parsimonious Tree Summary

Do you like looking at trees, but hate scrolling?

treesum takes a complex tree, and tries to show the most information without printing too many lines.

The tree is expected to consist of nodes, each of which has a weight. treesum will expand branches with highest weight and collapse those with lowest. The weights are a measure of how much you care about different nodes of the tree: They can be file sizes, diff deltas, how much you like each item, whatever you want. If you don't provide weights, all nodes will be assumed to have a weight of 1.

Usage

Summarize list of paths:

find . | treesum paths

Summarize rsync changelist:

rsync -raihP --dry-run /source/dir /dest/dir > rsync.txt
treesum rsync < rsync.txt

You can, of course, also use treesum as a library. The basic method is treesum.summarize.summarize_tree which takes a tree constructed from treesum.summarize.Node instances. If you don't want to do this by hand, treesum.convert contains methods for constructing a tree from various text representations. Try looking at the implementation of treesum.cli for an example of how to do this.

Install

Run: pip install treesum

Release files for treesum 0.3.3

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

Source distribution (sdist)

Source distribution for treesum 0.3.3
File Size Uploaded
treesum-0.3.3.tar.gz 4.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for treesum 0.3.3
File Interpreter ABI Platform
treesum-0.3.3-py3-none-any.whl Python 3 none any Details

Total release size: 9.7 kB

Release files / treesum-0.3.3.tar.gz

Download URL treesum-0.3.3.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4e6dfe001b89dbf0e7d10e5413a8b9c36f71182d9ebc928ca7e8b96636b4b323
BLAKE2b-256 checksum
How to use checksums
3069b5c6447fa38f35b00f800dee9fc14907e8e2cee403d7cc1849036d5b00f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/29.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.60.0 importlib-metadata/4.0.1 keyring/23.0.1 rfc3986/1.4.0 colorama/0.4.5 CPython/3.10.6

Release files / treesum-0.3.3-py3-none-any.whl

Download URL treesum-0.3.3-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2c5ec75ab764aecde155b5d6b071fa32e57b33211b5cede460c65e2a63c30080
BLAKE2b-256 checksum
How to use checksums
84d3b70725f7e6086a52657042c207a4d93a269c4add4c668b2b1bd7908adcef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/29.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.60.0 importlib-metadata/4.0.1 keyring/23.0.1 rfc3986/1.4.0 colorama/0.4.5 CPython/3.10.6

Release history Release notifications | RSS feed

This release

0.3.3 This release

2 release files

0.3.2

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