Skip to main content

Utility and library for summarizing trees.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

treesum-0.3.3.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

treesum-0.3.3-py3-none-any.whl (5.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page