Directory treemap visualization tool using Plotly
You can install the package via pip:
pip install dirtreemap
You can use the dirtreemap
command in your terminal to generate a treemap visualization of a directory. For example:
dirtreemap /path/to/directory /path/to/output_dir --report-filename treemap.html
This will create an HTML file with the treemap visualization of the specified directory. You can also customize the visualization using various options. For a full list of options, run:
dirtreemap --help
Note
A log file named
dirtreemap.log
will be created in the specified output directory to record scan and generation details.
Here's an example of how to use dirtreemap
in a Python script:
import os
from pathlib import Path
from directory_treemap import DirectoryTreemap
scan_dir: Path = Path(os.path.expanduser("~"))
dtm: DirectoryTreemap = DirectoryTreemap(base_path=scan_dir,
output_dir=Path("."),
parallel=False)
dtm.scan()
dtm.generate_treemap(title='Demo Directory Treemap',
max_depth=4,
max_files=25)
dtm.save_report()
dtm.open_report()
This will generate a treemap visualization of the specified directory and save it as treemap.html
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
This project is licensed under the MIT License. See the LICENSE file for details