Skip to content

Commit e4bc408

Browse files
committed
docs: expand documentation and bump version to 0.5.0
- New pages: Installation, Remote Sources, Guides, Troubleshooting - Examples page restructured as a visual gallery with new screenshots (diff, highlight, log-scale before/after, archive, interactive SVG) - Images moved to docs/images/; make_examples_images.sh added - Use cases section added to README and home page - API snippets tested; t_scan param made optional with default 0.0 - Home directory replaced with ~ in Scanning… messages - make_docs_images.sh --size flag corrected to --canvas - pre-commit: mypy hook uses --all-extras; docs/images/ excluded from large-file check
1 parent 1e8cb49 commit e4bc408

36 files changed

Lines changed: 1967 additions & 1153 deletions

.pre-commit-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ repos:
77
- id: check-yaml
88
- id: check-toml
99
- id: check-added-large-files
10+
exclude: ^docs/images/
1011
- id: check-merge-conflict
1112

1213
- repo: https://github.com/astral-sh/ruff-pre-commit
@@ -20,7 +21,7 @@ repos:
2021
hooks:
2122
- id: mypy
2223
name: mypy
23-
entry: uv run mypy src
24+
entry: uv run --all-extras mypy src
2425
language: system
2526
pass_filenames: false
2627
types: [python]

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.5.0] - 2026-05-20
11+
12+
### Documentation
13+
14+
- Documentation greatly expanded: new dedicated pages for Installation, Examples, Remote Sources, Guides, and Troubleshooting; richer use-case descriptions; API page updated with tested code snippets; CLI reference reordered to match `dirplot -h`.
15+
1016
### Changed
1117

1218
- **`read-meta` renamed to `meta`**`dirplot read-meta` is now `dirplot meta`. The new command

CONTRIBUTING.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,18 @@ uv run pytest tests/test_cli.py
2323
uv run pytest tests/test_drawing.py::test_cushion_shading -v
2424
```
2525

26+
## Archive test fixtures
27+
28+
`tests/fixtures/` contains one pre-built archive per supported format. To regenerate them:
29+
30+
```bash
31+
python scripts/make_fixtures.py
32+
```
33+
34+
The script creates a small sample tree and archives it in every supported format. The RAR fixture is skipped automatically if the `rar` CLI is not found.
35+
36+
The pytest `sample_archives` session fixture in `tests/conftest.py` regenerates the same files into a temporary directory at test-session start, so running the script is not required for CI or for running the test suite locally.
37+
2638
## Code Style
2739

2840
This project uses [ruff](https://docs.astral.sh/ruff/) for linting and formatting, and [mypy](https://mypy.readthedocs.io/) for type checking. Pre-commit hooks run these automatically on each commit.

README.md

Lines changed: 25 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
[![Python](https://img.shields.io/pypi/pyversions/dirplot.svg)](https://pypi.org/project/dirplot/)
66
[![Downloads](https://img.shields.io/pypi/dm/dirplot.svg)](https://pepy.tech/project/dirplot)
77
[![License](https://img.shields.io/pypi/l/dirplot.svg)](https://pypi.org/project/dirplot/)
8+
[![Docs](https://img.shields.io/badge/docs-deeplook.github.io%2Fdirplot-blue)](https://deeplook.github.io/dirplot)
89
[![Buy Me a Coffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-ffdd00?style=flat&logo=buy-me-a-coffee&logoColor=black)](https://www.buymeacoffee.com/deeplook)
910

1011
**dirplot** creates nested treemap images for directory trees. It can display them in the system image viewer or inline in the terminal (iTerm2 and Kitty protocols, auto-detected). It also animates git history, watches live filesystems, and scans remote sources.
@@ -15,28 +16,18 @@ dirplot map . # treemap of current directory, opens in system viewer
1516
dirplot map . --inline # display inline in terminal (iTerm2 / Kitty / Ghostty)
1617
```
1718

18-
![dirplot output](https://raw.githubusercontent.com/deeplook/dirplot/main/docs/dirplot.png)
19+
![dirplot output](https://raw.githubusercontent.com/deeplook/dirplot/main/docs/images/dirplot.png)
1920

20-
## Where to start
21+
## Use cases
2122

22-
| I want to… | Go to |
23-
|---|---|
24-
| Scan a local directory or archive | [Quick start](#quick-start) |
25-
| Scan a GitHub repo, S3 bucket, SSH host, or container | [Remote access & examples](docs/EXAMPLES.md) |
26-
| Scan Google Drive | [Google Drive](docs/EXAMPLES.md#google-drive) |
27-
| Animate git history or watch live filesystems | [Git History Animation](docs/EXAMPLES.md#git-history-animation) |
28-
| Use dirplot from Python | [Python API](docs/API.md) |
29-
| Run in Docker | [Running via Docker](docs/CLI.md#running-dirplot-via-docker) |
30-
| Fix an error | [Troubleshooting](docs/CLI.md#troubleshooting) |
31-
32-
## How to run dirplot
33-
34-
| Method | Command | Notes |
35-
|---|---|---|
36-
| Installed CLI | `dirplot map .` | After `pip install` / `uv tool install` |
37-
| No install (uv) | `uvx dirplot map .` | Runs the latest release ephemerally |
38-
| Python API | `from dirplot import build_tree, create_treemap` | See [API.md](docs/API.md) |
39-
| Docker | `docker run --rm dirplot dirplot map … --output -` | See [Docker](docs/CLI.md#running-dirplot-via-docker) |
23+
- **Find what's eating your disk** — map `~/Downloads`, `~/.cache`, or `node_modules` across a monorepo to spot the culprits at a glance.
24+
- **Inspect before you install** — visualise a Python wheel, JAR, or RPM without unpacking it.
25+
- **Understand a codebase instantly** — map a legacy project or a large GitHub repo to grasp its structure before reading a single line.
26+
- **Compare releases** — diff two archive versions or two git tags to see exactly what grew, shrank, or disappeared.
27+
- **Scan remote filesystems** — map an SSH host, S3 bucket, Docker container, or Kubernetes pod without copying anything locally.
28+
- **AI & data exploration** — map a vector database, model weights directory, or agent memory folder (`~/.claude/projects/`).
29+
- **Sysadmin at a glance** — map `/var/log` to see which services generate the most logs, or scan a container image's filesystem layers.
30+
- **Animate history** — watch a repository or live filesystem evolve over time as a timelapse.
4031

4132
## Features
4233

@@ -85,59 +76,25 @@ pip install dirplot
8576
## Quick start
8677

8778
```bash
88-
dirplot map . # current directory
89-
dirplot map . --inline # display in terminal (iTerm2/Kitty)
90-
dirplot map . --output treemap.png --no-show # save to file
91-
dirplot map . --log-scale 4 --inline # log scale (4× ratio), inline
92-
dirplot map github://pallets/flask # GitHub repo
93-
dirplot map gdrive:// # Google Drive root (requires gog)
94-
dirplot map docker://my-container:/app # Docker container
95-
dirplot map project.zip # archive file
96-
tree src/ | dirplot map # pipe tree output
97-
98-
dirplot git . -o snapshot.png # static snapshot of HEAD
99-
dirplot git .@v1.0 --inline # inline snapshot at tag
100-
dirplot git . -o history.mp4 --range main # full git history
101-
dirplot git . -o history.mp4 --period 30d # last 30 days
102-
dirplot git github://owner/repo -o h.mp4 --period 7d # GitHub, last week
103-
104-
dirplot hg /path/to/repo -o history.png --range 0:tip # full hg history
105-
dirplot hg /path/to/repo@tip -o history.png # static, tip only
106-
107-
dirplot watch . --snapshot treemap.png # live watch, snapshot on each change
108-
dirplot watch . --event-log events.jsonl # record events for replay
109-
dirplot replay events.jsonl -o timelapse.mp4 --total-duration 30 # render recording as MP4
110-
111-
dirplot demo # run examples, save to ./demo/
112-
113-
dirplot metrics . # scan metrics: counts, size, top extensions
114-
dirplot metrics . --sort-by size # sort extensions by total bytes
115-
dirplot metrics . --top 5 --json # top-5 entries as JSON
116-
dirplot map . --metrics --no-show # treemap + metrics in one pass
117-
118-
dirplot diff . # uncommitted changes (git/hg)
119-
dirplot diff . --changed-only # only show changed files
120-
dirplot diff .@HEAD~5 .@HEAD # last 5 commits
121-
dirplot diff old/ new/ # compare two directories
122-
dirplot diff old/ new/ --output diff.png --no-show # save to file
123-
dirplot diff github://owner/repo@v1 github://owner/repo@v2 # compare two GitHub tags
124-
dirplot diff archive_v1.tar.gz archive_v2.zip # compare two archives
79+
dirplot map . # current directory, opens in viewer
80+
dirplot map . --inline # display in terminal (iTerm2/Kitty/Ghostty)
81+
dirplot map . --output treemap.png --no-show # save to file
82+
dirplot map . --log-scale 4 # log scale when one file dominates
83+
dirplot map github://pallets/flask # GitHub repo
84+
dirplot map project.zip # archive — no unpacking needed
85+
86+
dirplot diff . # uncommitted changes
87+
dirplot diff .@HEAD~5 .@HEAD # last 5 commits
88+
89+
dirplot metrics . # file counts, sizes, top extensions
90+
dirplot git . --range main --output h.mp4 # full git history as MP4
12591
```
12692

127-
**Docker** — build once, then pipe output to the host:
128-
129-
```bash
130-
docker build -t dirplot .
131-
docker run --rm dirplot dirplot map github://steipete/birdclaw --output - | imgcat
132-
```
93+
See the [full documentation](https://deeplook.github.io/dirplot) for the complete command reference.
13394

13495
## Documentation
13596

136-
- [CLI reference](docs/CLI.md) — all commands, flags, and usage examples
137-
- [Remote access & examples](docs/EXAMPLES.md) — SSH, S3, GitHub, Docker, Kubernetes, git history animation
138-
- [Archive formats](docs/ARCHIVES.md) — supported formats and dependencies
139-
- [Python API](docs/API.md) — programmatic usage
140-
- [Troubleshooting](docs/CLI.md#troubleshooting) — common issues and fixes
97+
Full documentation is available at **[deeplook.github.io/dirplot](https://deeplook.github.io/dirplot)**.
14198

14299
## Development
143100

docs/API.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Python API
22

3+
[Home](index.md)
4+
35
> **Note:** The programmatic Python API is still evolving and may change between releases without notice. Pin a specific version if you depend on it. The CLI interface is stable.
46
57
The public API centres on `build_tree`, `create_treemap`, and `create_treemap_svg`:
@@ -59,17 +61,17 @@ from dirplot.scanner import tree_metrics, tree_metrics_dict
5961
root = build_tree(Path("/path/to/project"))
6062

6163
# Human-readable string (same as CLI output)
62-
print(tree_metrics(root, t_scan=0.0))
64+
print(tree_metrics(root))
6365

6466
# Sort extensions by total bytes instead of file count
65-
print(tree_metrics(root, t_scan=0.0, sort_by="size"))
67+
print(tree_metrics(root, sort_by="size"))
6668

6769
# Limit to top 5 entries per list
68-
print(tree_metrics(root, t_scan=0.0, top_n=5))
70+
print(tree_metrics(root, top_n=5))
6971

7072
# Structured dict — suitable for JSON serialisation or downstream processing
7173
import json
72-
data = tree_metrics_dict(root, t_scan=0.0)
74+
data = tree_metrics_dict(root)
7375
print(json.dumps(data, indent=2))
7476
```
7577

@@ -100,7 +102,7 @@ print(json.dumps(data, indent=2))
100102

101103
## Remote backends
102104

103-
Each remote backend exposes a `build_tree_*` function that returns the same `Node` type accepted by `create_treemap`. See [EXAMPLES.md](EXAMPLES.md) for full per-backend documentation and authentication details.
105+
Each remote backend exposes a `build_tree_*` function that returns the same `Node` type accepted by `create_treemap`. See [EXAMPLES.md](examples.md) for full per-backend documentation and authentication details.
104106

105107
```python
106108
# GitHub
@@ -130,4 +132,9 @@ root = build_tree_docker("my-container", "/app", depth=5)
130132
# Kubernetes
131133
from dirplot.k8s import build_tree_pod
132134
root = build_tree_pod("my-pod", "/app", namespace="staging", container="main", depth=5)
135+
136+
# Google Drive (requires gog CLI: brew install gogcli && gog auth)
137+
from dirplot.gdrive import build_tree_gdrive
138+
root = build_tree_gdrive(depth=3) # Drive root
139+
root = build_tree_gdrive("1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms", depth=5) # specific folder
133140
```

docs/ARCHIVES.md

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Archive file support
1+
# Archive Formats
2+
3+
[Home](index.md)
24

35
dirplot can read local archive files as treemap inputs without unpacking them.
46
The archive is treated as a virtual directory: its members form the node tree
@@ -123,21 +125,6 @@ xattr -d com.apple.quarantine /opt/homebrew/bin/rar
123125

124126
After that the binary runs normally.
125127

126-
## Test fixtures
127-
128-
`tests/fixtures/` contains one pre-built archive per format. They are
129-
generated by:
130-
131-
```bash
132-
python scripts/make_fixtures.py
133-
```
134-
135-
The script creates a small sample tree and archives it in every supported format. The RAR fixture is skipped automatically if the `rar` CLI is not found.
136-
137-
The pytest `sample_archives` session fixture in `tests/conftest.py` regenerates
138-
the same files into a temporary directory at test-session start, so running the
139-
script is not required for CI or for running the test suite locally.
140-
141128
## Intentionally unsupported formats
142129

143130
**`.deb` (Debian/Ubuntu packages)** — a `.deb` file is an `ar` archive whose

0 commit comments

Comments
 (0)