Skip to main content

CLI script to measure the volume of a directory tree

Project description

tree_stat

Count files and their size in a directory tree with stats for each level.

Given a tree:

0_0_root/
├── 1_0_leaf
│   ├── bold-blackburn.txt
│   ├── funny-lederberg.txt
│   └── inspiring-kirch.blu
├── 1_1_node
│   ├── 2_0_leaf
│   │   ├── adoring-dhawan.mp4
│   │   ├── festive-haslett.html
│   │   ├── interesting-poincare.jpg
│   │   └── vigorous-hopper.blu
│   ├── 2_1_node
│   │   ├── 3_0_leaf
│   │   │   └── jolly-williamson.json
│   │   └── stoic-napier.jpg
│   ├── 2_2_node
│   │   ├── 3_0_node
│   │   │   ├── 4_0_leaf
│   │   │   │   ├── stupefied-kilby.json
│   │   │   │   └── thirsty-fermi.json
│   │   │   └── 4_1_leaf
│   │   ├── 3_1_node
│   │   │   └── 4_0_leaf
│   │   │       ├── nice-franklin.json
│   │   │       └── quirky-greider.blu
│   │   ├── goofy-bose.html
│   │   ├── keen-jones.blu
│   │   ├── nervous-edison.mp4
│   │   └── nifty-mendeleev.html
│   ├── naughty-wu.jpg
│   ├── pensive-minsky.mp3
│   └── sleepy-boyd.mp3
└── 1_2_node
    ├── 2_0_node
    │   └── 3_0_leaf
    │       ├── great-lewin.mp3
    │       └── romantic-northcutt.mp3
    ├── condescending-banach.jpg
    ├── modest-chandrasekhar.jpg
    ├── objective-mendel.blu
    └── zen-noyce.mp4

14 directories, 26 files

It produces:

directory type count size
0_0_root ALL 26 29.914 MiB
0_0_root .mp3 4 3.901 MiB
0_0_root .jpg 5 211.019 KiB
0_0_root .blu 5 9.829 MiB
0_0_root .html 3 549.206 KiB
0_0_root .mp4 3 15.357 MiB
0_0_root .json 4 64.902 KiB
0_0_root .txt 2 21.407 KiB
0_0_root/1_2_node ALL 6 12.852 MiB
0_0_root/1_2_node .jpg 2 53.018 KiB
0_0_root/1_2_node .mp4 1 7.573 MiB
0_0_root/1_2_node .blu 1 2.321 MiB
0_0_root/1_2_node .mp3 2 2.907 MiB
0_0_root/1_2_node/2_0_node ALL 2 2.907 MiB
0_0_root/1_2_node/2_0_node .mp3 2 2.907 MiB
0_0_root/1_2_node/2_0_node/3_0_leaf ALL 2 2.907 MiB
0_0_root/1_2_node/2_0_node/3_0_leaf .mp3 2 2.907 MiB
0_0_root/1_0_leaf ALL 3 1.588 MiB
0_0_root/1_0_leaf .txt 2 21.407 KiB
0_0_root/1_0_leaf .blu 1 1.567 MiB
0_0_root/1_1_node ALL 17 15.474 MiB
0_0_root/1_1_node .mp3 2 1018.227 KiB
0_0_root/1_1_node .jpg 3 158.001 KiB
0_0_root/1_1_node .blu 3 5.941 MiB
0_0_root/1_1_node .html 3 549.206 KiB
0_0_root/1_1_node .mp4 2 7.785 MiB
0_0_root/1_1_node .json 4 64.902 KiB
0_0_root/1_1_node/2_0_leaf ALL 4 3.698 MiB
0_0_root/1_1_node/2_0_leaf .jpg 1 55.229 KiB
0_0_root/1_1_node/2_0_leaf .mp4 1 1.282 MiB
0_0_root/1_1_node/2_0_leaf .blu 1 2.059 MiB
0_0_root/1_1_node/2_0_leaf .html 1 310.553 KiB
0_0_root/1_1_node/2_1_node ALL 2 60.127 KiB
0_0_root/1_1_node/2_1_node .jpg 1 51.771 KiB
0_0_root/1_1_node/2_1_node .json 1 8.355 KiB
0_0_root/1_1_node/2_1_node/3_0_leaf ALL 1 8.355 KiB
0_0_root/1_1_node/2_1_node/3_0_leaf .json 1 8.355 KiB
0_0_root/1_1_node/2_2_node ALL 8 10.673 MiB
0_0_root/1_1_node/2_2_node .blu 2 3.882 MiB
0_0_root/1_1_node/2_2_node .html 2 238.653 KiB
0_0_root/1_1_node/2_2_node .mp4 1 6.502 MiB
0_0_root/1_1_node/2_2_node .json 3 56.547 KiB
0_0_root/1_1_node/2_2_node/3_0_node ALL 2 34.133 KiB
0_0_root/1_1_node/2_2_node/3_0_node .json 2 34.133 KiB
0_0_root/1_1_node/2_2_node/3_0_node/4_1_leaf ALL 0 0 B
0_0_root/1_1_node/2_2_node/3_0_node/4_0_leaf ALL 2 34.133 KiB
0_0_root/1_1_node/2_2_node/3_0_node/4_0_leaf .json 2 34.133 KiB
0_0_root/1_1_node/2_2_node/3_1_node ALL 2 2.202 MiB
0_0_root/1_1_node/2_2_node/3_1_node .json 1 22.414 KiB
0_0_root/1_1_node/2_2_node/3_1_node .blu 1 2.180 MiB
0_0_root/1_1_node/2_2_node/3_1_node/4_0_leaf ALL 2 2.202 MiB
0_0_root/1_1_node/2_2_node/3_1_node/4_0_leaf .json 1 22.414 KiB
0_0_root/1_1_node/2_2_node/3_1_node/4_0_leaf .blu 1 2.180 MiB

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

tree_stat-0.2.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

tree_stat-0.2.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file tree_stat-0.2.0.tar.gz.

File metadata

  • Download URL: tree_stat-0.2.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1

File hashes

Hashes for tree_stat-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0447069433703b7617e6362d076bfdd6f04c8d1d44ea1f9b72e649dfe8b64778
MD5 bad99a20b8d848191bb72fe5acb0ad9e
BLAKE2b-256 29d458f7c7afe9bd4f7b4f35cd7eac8d0b3ee7b4da12749e0e4c2d73a6b37316

See more details on using hashes here.

File details

Details for the file tree_stat-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: tree_stat-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1

File hashes

Hashes for tree_stat-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 44cdd098d6da6a8495f5d5e21c3391ea22f1a50c9d9d8cf8a0ba632fb066513d
MD5 ca5091fb823396041033ee665b763f18
BLAKE2b-256 13a7471b8ed0982630dec3ed68d913b3a6bd5a92bb09af6cc3a86f3d767b3624

See more details on using hashes here.

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