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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file treesum-0.3.3.tar.gz.
File metadata
- Download URL: treesum-0.3.3.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e6dfe001b89dbf0e7d10e5413a8b9c36f71182d9ebc928ca7e8b96636b4b323
|
|
| MD5 |
c241ceceff8891d944cd969304f19617
|
|
| BLAKE2b-256 |
3069b5c6447fa38f35b00f800dee9fc14907e8e2cee403d7cc1849036d5b00f0
|
File details
Details for the file treesum-0.3.3-py3-none-any.whl.
File metadata
- Download URL: treesum-0.3.3-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c5ec75ab764aecde155b5d6b071fa32e57b33211b5cede460c65e2a63c30080
|
|
| MD5 |
ca765143b07edd6c9edff52b4a32b440
|
|
| BLAKE2b-256 |
84d3b70725f7e6086a52657042c207a4d93a269c4add4c668b2b1bd7908adcef
|