Sort folders and files by size and display it in folder tree format.
Project description
pysortfolder
Sort folders and files by size and display it in folder tree format.
Usage
from pysortfolder import PySortFolder
PySortFolder(path='PATH/TO/ROOT/FOLDER')
sf.make_tree(reverse=False) # support reverse=True
sf.print_tree()
# data, size: 82
# ├── subfolder3, size: 0
# │ └── subsubfolder2, size: 0
# │ └── subsubsubfolder1, size: 0
# │ ├── subsubsubsubfolder1, size: 0
# │ └── subsubsubfolder1_text1.txt, size: 0
# ├── subfolder2, size: 17
# │ └── subfolder2_text1.txt, size: 17
# ├── subfolder1, size: 54
# │ ├── subsubfolder1, size: 20
# │ │ └── subsubfolder1_text1.txt, size: 20
# │ ├── subfolder1_text1.txt, size: 17
# │ └── subfolder1_text2.txt, size: 17
# └── root_text1.txt, size: 11
from pysortfolder import dir_size
print(dir_size(path='PATH/TO/ROOT/FOLDER')) # print the size of the root
# 82
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
pysortfolder-0.0.4.tar.gz
(5.1 kB
view details)
Built Distribution
File details
Details for the file pysortfolder-0.0.4.tar.gz
.
File metadata
- Download URL: pysortfolder-0.0.4.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1dd9aaa016a0066be79c1d91b1fbd1c5f9510755f4c85aa6c89ffef84468dff3 |
|
MD5 | 791c4fc4eb81ccf215ed451b82ad9d08 |
|
BLAKE2b-256 | 06b1530559f20bf914e07a12894b26a74c152cd1d47bff9776b2cfd0ec4bb6c1 |
File details
Details for the file pysortfolder-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: pysortfolder-0.0.4-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca7344305a9a2a11d12dcd4059740657b33113932a01344c3f5e888372069c37 |
|
MD5 | 5532fe27ff2b95885e391e0a53a26a6c |
|
BLAKE2b-256 | e17033ef37f5664716142f54ee91cc4b50a5ee38f3cbb6f8419f32b8c9341799 |