dutree :: Disk usage summary
dutree shows a summary of the directories/files which take up the most space.
Instead of showing only the root of the files with sizes, or the details of every file, it shows only the paths taking up the most space.
Example usage:
$ dutree /srv --apparent-size
Annotated output, where only paths of >5% of the total size are shown (which is about 4GB for this dataset):
12.1 G /srv/data/audiofiles/
^-- audiofiles contains files/dirs with a total of 12.1G
but it does NOT contain a single dir or file larger
than 4G.
4.3 G /srv/data/callrecordings/unmatched/
4.5 G /srv/data/fax/
17.5 G /srv/data/playlists/
34.4 G /srv/data/twinfield_invoices/1/
7.8 G /srv/data/*
^-- data contains more files/directories than shown above
but those that don't total above 4G are merged into
this "leftover" node. that includes everything in
/twinfield_invoices/ except for the /1/ subdirectory
which has its individual listing above.
32 B /srv/*
^-- only /data/ is in /srv/, but the directory itself also
takes up a tiny bit of space
-----
80.6 G TOTAL (86558511658)
NOTE: The directories do not count the size of themselves, only of their contents. This explains any discrepancies with du -sb output.
Library usage:
>>> from dutree import Scanner
>>> scanner = Scanner('/srv')
>>> tree = scanner.scan(use_apparent_size=True)
>>> tree.app_size()
86558511658
>>> len(tree.get_leaves())
7
>>> leaf0 = tree.get_leaves()[0]
>>> leaf0.name()
'/srv/data/audiofiles/'
>>> leaf0.app_size() / (1024.0 * 1024 * 1024)
12.092280263081193
Development:
Please run the python2 and python3 tests after developing:
python2 dutree/test_dutree.py python3 dutree/test_dutree.py
History
v1.8
Add experimental feature to do scanning from a file instead of the filesystem. See commit bbebcf98 for details. Original code by Seppe Lucas.
v1.7
Skip /proc and /sys filesystems by default.
Use –xdev to stay on the same filesystem.
Uses –count-blocks by default; use –apparent-size to negate.
v1.6
Fix so the tests work with Python 3 as well.
Fix grave bugs with real size. The real size calculation was wrong sometimes, it could raise assertions or the leaf count could be off.
v1.5
Add apparent vs. real size. Deprecates node.size(). Use node.app_size() instead. Get the real used size using node.use_size(). Group by real used size by passing use_apparent_size=False to scan().
Don’t die if we cannot enter directories.
Metadata
Release files for dutree 1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dutree-1.8.tar.gz | 15.3 kB | Without provenance | Details for dutree-1.8.tar.gz |
Release files / dutree-1.8.tar.gz
| Download URL | dutree-1.8.tar.gz |
|---|---|
| Size | 15.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b9849b36c05cae7cee15fa4d7047ce6c73c9bca6fd91abf6acc6d3d44162be92
|
|
BLAKE2b-256 checksum How to use checksums |
4bcbb4eead7e4820937df45b5f15247571d375359c51f6061ebc693ddd884286
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
|
Security for dutree 1.8
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.