A disk usage analyzer that scans a directory and prints a visual tree map of folder sizes — right in your terminal.
pip install -e .pip uninstall python-du
python-du [path] [options]If no path is given, the current directory is scanned.
| Flag | Description |
|---|---|
-d, --max-depth N |
Maximum tree depth to display (default: 4) |
-m, --min-percent N |
Hide entries smaller than N% of total (default: 0.5) |
--no-color |
Disable colored output |
--sort-alpha |
Sort alphabetically instead of by size |
--scan-depth N |
Limit how deep the filesystem scan goes (default: unlimited) |
-L, --follow-symlinks |
Follow symbolic links |
Scan the current directory with defaults:
python-duScan /var/log showing only entries above 5%, two levels deep:
python-du /var/log -d 2 -m 5Pipe to a file (automatically disables color):
python-du /home > usage-report.txtpip install build twine
python -m build
twine upload dist/*
When prompted, use __token__ as the username and your PyPI API token as the password.
To skip the prompt, create a ~/.pypirc file:
[pypi]
username = __token__
password = pypi-YOUR-TOKEN-HERENote: Bump the
versioninpyproject.tomlbefore each upload — PyPI rejects duplicate version numbers.
- Python >= 3.9
- No external dependencies
