dirplot 0.4.0__tar.gz → 0.4.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. {dirplot-0.4.0 → dirplot-0.4.1}/.gitignore +1 -0
  2. dirplot-0.4.1/ANIMATION.md +27 -0
  3. {dirplot-0.4.0 → dirplot-0.4.1}/CHANGELOG.md +83 -0
  4. dirplot-0.4.1/PKG-INFO +130 -0
  5. dirplot-0.4.1/README.md +80 -0
  6. dirplot-0.4.1/docs/API.md +72 -0
  7. dirplot-0.4.1/docs/CLI.md +359 -0
  8. {dirplot-0.4.0 → dirplot-0.4.1}/docs/EXAMPLES.md +22 -4
  9. {dirplot-0.4.0 → dirplot-0.4.1}/pyproject.toml +1 -1
  10. {dirplot-0.4.0 → dirplot-0.4.1}/src/dirplot/git_scanner.py +13 -7
  11. {dirplot-0.4.0 → dirplot-0.4.1}/src/dirplot/github.py +25 -5
  12. {dirplot-0.4.0 → dirplot-0.4.1}/src/dirplot/main.py +516 -28
  13. {dirplot-0.4.0 → dirplot-0.4.1}/src/dirplot/render_png.py +93 -18
  14. {dirplot-0.4.0 → dirplot-0.4.1}/src/dirplot/replay_scanner.py +2 -0
  15. {dirplot-0.4.0 → dirplot-0.4.1}/src/dirplot/svg_render.py +34 -17
  16. {dirplot-0.4.0 → dirplot-0.4.1}/src/dirplot/watch.py +42 -2
  17. {dirplot-0.4.0 → dirplot-0.4.1}/tests/test_cli.py +198 -0
  18. dirplot-0.4.1/tests/test_git_local.py +322 -0
  19. dirplot-0.4.1/tests/test_git_scanner.py +360 -0
  20. {dirplot-0.4.0 → dirplot-0.4.1}/tests/test_github.py +69 -2
  21. {dirplot-0.4.0 → dirplot-0.4.1}/tests/test_render_png.py +105 -1
  22. dirplot-0.4.1/tests/test_replay_scanner.py +286 -0
  23. {dirplot-0.4.0 → dirplot-0.4.1}/tests/test_watch_animate.py +221 -0
  24. {dirplot-0.4.0 → dirplot-0.4.1}/uv.lock +1 -1
  25. dirplot-0.4.0/PKG-INFO +0 -481
  26. dirplot-0.4.0/README.md +0 -431
  27. dirplot-0.4.0/TASKS.md~ +0 -24
  28. dirplot-0.4.0/demo.yaml~ +0 -16
  29. dirplot-0.4.0/tests/test_git_local.py +0 -153
  30. {dirplot-0.4.0 → dirplot-0.4.1}/.claude/settings.local.json +0 -0
  31. {dirplot-0.4.0 → dirplot-0.4.1}/.dockerignore +0 -0
  32. {dirplot-0.4.0 → dirplot-0.4.1}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  33. {dirplot-0.4.0 → dirplot-0.4.1}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  34. {dirplot-0.4.0 → dirplot-0.4.1}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  35. {dirplot-0.4.0 → dirplot-0.4.1}/.github/dependabot.yml +0 -0
  36. {dirplot-0.4.0 → dirplot-0.4.1}/.github/workflows/ci.yml +0 -0
  37. {dirplot-0.4.0 → dirplot-0.4.1}/.github/workflows/publish.yml +0 -0
  38. {dirplot-0.4.0 → dirplot-0.4.1}/.ipynb_checkpoints/Untitled-checkpoint.ipynb +0 -0
  39. {dirplot-0.4.0 → dirplot-0.4.1}/.pre-commit-config.yaml +0 -0
  40. {dirplot-0.4.0 → dirplot-0.4.1}/.python-version +0 -0
  41. {dirplot-0.4.0 → dirplot-0.4.1}/CONTRIBUTING.md +0 -0
  42. {dirplot-0.4.0 → dirplot-0.4.1}/Dockerfile +0 -0
  43. {dirplot-0.4.0 → dirplot-0.4.1}/LICENSE +0 -0
  44. {dirplot-0.4.0 → dirplot-0.4.1}/LICENSE2 +0 -0
  45. {dirplot-0.4.0 → dirplot-0.4.1}/Makefile +0 -0
  46. {dirplot-0.4.0 → dirplot-0.4.1}/SECURITY.md +0 -0
  47. {dirplot-0.4.0 → dirplot-0.4.1}/demo.yaml +0 -0
  48. {dirplot-0.4.0 → dirplot-0.4.1}/docs/ARCHIVES.md +0 -0
  49. {dirplot-0.4.0 → dirplot-0.4.1}/docs/SSH_DESIGN.md +0 -0
  50. {dirplot-0.4.0 → dirplot-0.4.1}/echo +0 -0
  51. {dirplot-0.4.0 → dirplot-0.4.1}/gen_asciicast.py +0 -0
  52. {dirplot-0.4.0 → dirplot-0.4.1}/paths.txt +0 -0
  53. {dirplot-0.4.0 → dirplot-0.4.1}/src/dirplot/__init__.py +0 -0
  54. {dirplot-0.4.0 → dirplot-0.4.1}/src/dirplot/__main__.py +0 -0
  55. {dirplot-0.4.0 → dirplot-0.4.1}/src/dirplot/archives.py +0 -0
  56. {dirplot-0.4.0 → dirplot-0.4.1}/src/dirplot/colors.py +0 -0
  57. {dirplot-0.4.0 → dirplot-0.4.1}/src/dirplot/display.py +0 -0
  58. {dirplot-0.4.0 → dirplot-0.4.1}/src/dirplot/docker.py +0 -0
  59. {dirplot-0.4.0 → dirplot-0.4.1}/src/dirplot/fonts/JetBrainsMono-Bold.ttf +0 -0
  60. {dirplot-0.4.0 → dirplot-0.4.1}/src/dirplot/fonts/JetBrainsMono-BoldItalic.ttf +0 -0
  61. {dirplot-0.4.0 → dirplot-0.4.1}/src/dirplot/fonts/JetBrainsMono-Italic.ttf +0 -0
  62. {dirplot-0.4.0 → dirplot-0.4.1}/src/dirplot/fonts/JetBrainsMono-Regular.ttf +0 -0
  63. {dirplot-0.4.0 → dirplot-0.4.1}/src/dirplot/fonts/OFL.txt +0 -0
  64. {dirplot-0.4.0 → dirplot-0.4.1}/src/dirplot/k8s.py +0 -0
  65. {dirplot-0.4.0 → dirplot-0.4.1}/src/dirplot/pathlist.py +0 -0
  66. {dirplot-0.4.0 → dirplot-0.4.1}/src/dirplot/py.typed +0 -0
  67. {dirplot-0.4.0 → dirplot-0.4.1}/src/dirplot/s3.py +0 -0
  68. {dirplot-0.4.0 → dirplot-0.4.1}/src/dirplot/scanner.py +0 -0
  69. {dirplot-0.4.0 → dirplot-0.4.1}/src/dirplot/ssh.py +0 -0
  70. {dirplot-0.4.0 → dirplot-0.4.1}/src/dirplot/terminal.py +0 -0
  71. {dirplot-0.4.0 → dirplot-0.4.1}/test_file.txt +0 -0
  72. {dirplot-0.4.0 → dirplot-0.4.1}/test_file2.txt +0 -0
  73. {dirplot-0.4.0 → dirplot-0.4.1}/tests/__init__.py +0 -0
  74. {dirplot-0.4.0 → dirplot-0.4.1}/tests/conftest.py +0 -0
  75. {dirplot-0.4.0 → dirplot-0.4.1}/tests/example/bar/bar.py +0 -0
  76. {dirplot-0.4.0 → dirplot-0.4.1}/tests/example/bar/baz.json +0 -0
  77. {dirplot-0.4.0 → dirplot-0.4.1}/tests/example/foo/foo.md +0 -0
  78. {dirplot-0.4.0 → dirplot-0.4.1}/tests/fixtures/sample.7z +0 -0
  79. {dirplot-0.4.0 → dirplot-0.4.1}/tests/fixtures/sample.a +0 -0
  80. {dirplot-0.4.0 → dirplot-0.4.1}/tests/fixtures/sample.aab +0 -0
  81. {dirplot-0.4.0 → dirplot-0.4.1}/tests/fixtures/sample.apk +0 -0
  82. {dirplot-0.4.0 → dirplot-0.4.1}/tests/fixtures/sample.cpio +0 -0
  83. {dirplot-0.4.0 → dirplot-0.4.1}/tests/fixtures/sample.ear +0 -0
  84. {dirplot-0.4.0 → dirplot-0.4.1}/tests/fixtures/sample.epub +0 -0
  85. {dirplot-0.4.0 → dirplot-0.4.1}/tests/fixtures/sample.ipa +0 -0
  86. {dirplot-0.4.0 → dirplot-0.4.1}/tests/fixtures/sample.iso +0 -0
  87. {dirplot-0.4.0 → dirplot-0.4.1}/tests/fixtures/sample.jar +0 -0
  88. {dirplot-0.4.0 → dirplot-0.4.1}/tests/fixtures/sample.nupkg +0 -0
  89. {dirplot-0.4.0 → dirplot-0.4.1}/tests/fixtures/sample.rar +0 -0
  90. {dirplot-0.4.0 → dirplot-0.4.1}/tests/fixtures/sample.tar +0 -0
  91. {dirplot-0.4.0 → dirplot-0.4.1}/tests/fixtures/sample.tar.bz2 +0 -0
  92. {dirplot-0.4.0 → dirplot-0.4.1}/tests/fixtures/sample.tar.gz +0 -0
  93. {dirplot-0.4.0 → dirplot-0.4.1}/tests/fixtures/sample.tar.xz +0 -0
  94. {dirplot-0.4.0 → dirplot-0.4.1}/tests/fixtures/sample.tar.zst +0 -0
  95. {dirplot-0.4.0 → dirplot-0.4.1}/tests/fixtures/sample.tbz2 +0 -0
  96. {dirplot-0.4.0 → dirplot-0.4.1}/tests/fixtures/sample.tgz +0 -0
  97. {dirplot-0.4.0 → dirplot-0.4.1}/tests/fixtures/sample.txz +0 -0
  98. {dirplot-0.4.0 → dirplot-0.4.1}/tests/fixtures/sample.tzst +0 -0
  99. {dirplot-0.4.0 → dirplot-0.4.1}/tests/fixtures/sample.vsix +0 -0
  100. {dirplot-0.4.0 → dirplot-0.4.1}/tests/fixtures/sample.war +0 -0
  101. {dirplot-0.4.0 → dirplot-0.4.1}/tests/fixtures/sample.whl +0 -0
  102. {dirplot-0.4.0 → dirplot-0.4.1}/tests/fixtures/sample.xar +0 -0
  103. {dirplot-0.4.0 → dirplot-0.4.1}/tests/fixtures/sample.xpi +0 -0
  104. {dirplot-0.4.0 → dirplot-0.4.1}/tests/fixtures/sample.zip +0 -0
  105. {dirplot-0.4.0 → dirplot-0.4.1}/tests/test_archives.py +0 -0
  106. {dirplot-0.4.0 → dirplot-0.4.1}/tests/test_colors.py +0 -0
  107. {dirplot-0.4.0 → dirplot-0.4.1}/tests/test_display.py +0 -0
  108. {dirplot-0.4.0 → dirplot-0.4.1}/tests/test_docker.py +0 -0
  109. {dirplot-0.4.0 → dirplot-0.4.1}/tests/test_drawing.py +0 -0
  110. {dirplot-0.4.0 → dirplot-0.4.1}/tests/test_git_github.py +0 -0
  111. {dirplot-0.4.0 → dirplot-0.4.1}/tests/test_k8s.py +0 -0
  112. {dirplot-0.4.0 → dirplot-0.4.1}/tests/test_pathlist.py +0 -0
  113. {dirplot-0.4.0 → dirplot-0.4.1}/tests/test_s3.py +0 -0
  114. {dirplot-0.4.0 → dirplot-0.4.1}/tests/test_scanner.py +0 -0
  115. {dirplot-0.4.0 → dirplot-0.4.1}/tests/test_ssh.py +0 -0
  116. {dirplot-0.4.0 → dirplot-0.4.1}/tests/test_svg_render.py +0 -0
  117. {dirplot-0.4.0 → dirplot-0.4.1}/tests/test_terminal.py +0 -0
@@ -38,3 +38,4 @@ Thumbs.db
38
38
  NOTES.md
39
39
  TASKS.md
40
40
  tests/example_dirplot.png
41
+ demo/
@@ -0,0 +1,27 @@
1
+ # Animation design notes
2
+
3
+ ## `dirplot watch` — is non-animated mode useful?
4
+
5
+ The watch command has two modes:
6
+
7
+ - **Non-animated** (`dirplot watch . --output treemap.png`): regenerates and overwrites the
8
+ PNG on every debounced filesystem change. Useful paired with an auto-refreshing image
9
+ viewer (e.g. `feh --reload` on Linux) as a live dashboard.
10
+ - **Animated** (`dirplot watch . --output treemap.mp4 --animate`): each debounced render
11
+ becomes one frame; the complete APNG or MP4 is written on Ctrl-C.
12
+
13
+ The non-animated mode is a niche use case. The compelling reason to use `dirplot watch`
14
+ at all — vs. running `dirplot map .` on demand — is the animation: a timelapse of how
15
+ the filesystem changed over time.
16
+
17
+ The current design is also asymmetric: `--animate` produces a file *on exit*, while
18
+ non-animated produces a file *on every change*. They're almost opposite behaviours on
19
+ the same command.
20
+
21
+ ### Options to consider
22
+
23
+ 1. **Keep as-is**, but lead the docs with `--animate` as the primary use case.
24
+ 2. **Make `--animate` the default** for `watch`, keeping `--no-animate` for the
25
+ live-refresh use case — but this is a breaking change.
26
+ 3. **Document the live-refresh pattern explicitly** so non-animated mode doesn't look
27
+ like a half-baked feature.
@@ -7,6 +7,89 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.4.1] - 2026-04-03
11
+
12
+ ### Added
13
+
14
+ - **`--last PERIOD`** for `dirplot git` — filter commits by a relative time period instead
15
+ of (or in addition to) `--max-commits`. Accepts a number followed by a unit:
16
+ `m` (minutes), `h` (hours), `d` (days), `w` (weeks), `mo` (months = 30 days).
17
+ For GitHub URLs, uses `git clone --shallow-since` for an efficient date-bounded shallow
18
+ clone. `--last` and `--max-commits` may be combined (date filter + count cap both apply).
19
+ ```bash
20
+ dirplot git . -o history.mp4 --animate --last 30d
21
+ dirplot git . -o history.mp4 --animate --last 24h
22
+ dirplot git github://owner/repo -o history.mp4 --animate --last 2w --max-commits 10
23
+ ```
24
+
25
+ - **`dirplot demo` command** — new subcommand that runs a curated set of example commands
26
+ and saves outputs to a folder. Useful for first-time walkthroughs or verifying that
27
+ everything works in a given environment. Accepts `--output` (default: `demo/`),
28
+ `--github-url` (default: `https://github.com/deeplook/dirplot`), and
29
+ `--interactive` / `-i` to step through and confirm each command individually. Output
30
+ uses rich formatting with colour, section rules, and status indicators.
31
+ ```bash
32
+ dirplot demo # run all examples, save to ./demo/
33
+ dirplot demo --output ~/dp-demo --interactive
34
+ ```
35
+
36
+ - **`--fade-out` for animated output** — appends a fade-out sequence at the end of
37
+ animations produced by `dirplot git --animate`, `dirplot watch --animate`, and
38
+ `dirplot replay`. Four flags control the effect:
39
+ - `--fade-out` / `--no-fade-out` — enable/disable (default: off)
40
+ - `--fade-out-duration SECS` — total fade length in seconds (default: 1.0)
41
+ - `--fade-out-frames N` — number of blend steps; defaults to 4 per second of duration
42
+ so longer fades are automatically finer-grained
43
+ - `--fade-out-color COLOR` — target colour: `auto` (black in dark mode, white in light
44
+ mode), `transparent` (PNG/APNG only; fades to fully transparent), any CSS colour
45
+ name, or hex code (e.g. `"#1a1a2e"`)
46
+ ```bash
47
+ dirplot git . -o history.png --animate --fade-out
48
+ dirplot git . -o history.mp4 --animate --fade-out --fade-out-duration 2.0
49
+ dirplot git . -o history.png --animate --fade-out --fade-out-color transparent
50
+ ```
51
+
52
+ - **`--dark` / `--light` mode** for all treemap commands — controls background and border
53
+ colours. Dark mode (default) uses a near-black canvas with white directory labels; light
54
+ mode uses a white canvas with black labels. Available on `map`, `git`, `watch`, and
55
+ `replay`.
56
+ ```bash
57
+ dirplot map . --light
58
+ dirplot git . -o history.mp4 --animate --light
59
+ ```
60
+
61
+ - **Metadata in MP4/MOV output** — `dirplot git`, `dirplot watch`, and `dirplot replay`
62
+ now embed the same dirplot metadata (date, software version, OS, Python version,
63
+ executed command) into MP4/MOV files that was previously only written to PNG and SVG.
64
+ `dirplot read-meta` reads it back via `ffprobe`.
65
+
66
+ - **Automatic `gh` CLI credential fallback** — if `--github-token` and `GITHUB_TOKEN`
67
+ are both absent, dirplot silently runs `gh auth token`. Users authenticated with the
68
+ [GitHub CLI](https://cli.github.com/) (`gh auth login`) can access private repositories
69
+ with no extra configuration. Token resolution order: `--github-token` →
70
+ `$GITHUB_TOKEN` → `gh auth token`.
71
+
72
+ ### Changed
73
+
74
+ - `--fade-out-frames` defaults dynamically to `round(fade_out_duration × 4)` rather than
75
+ a fixed 4, so a 2-second fade automatically uses 8 frames and a 0.5-second fade uses 2.
76
+
77
+ ### Fixed
78
+
79
+ - **`--total-duration` overshooting the target length** — when many commits fell within
80
+ a burst (closely-spaced timestamps), their proportional frame durations would each be
81
+ raised to the 200 ms floor, inflating the total well beyond the requested duration
82
+ (e.g. 34 s instead of 30 s). The floor is still applied for readability, but the
83
+ non-floored frames are now scaled down to compensate so the sum always matches
84
+ `--total-duration` exactly.
85
+
86
+ ### Docs
87
+
88
+ - Added `## dirplot read-meta` section to `docs/CLI.md` (previously undocumented).
89
+ - Documented external tool requirements: `git` (required by `dirplot git`), `ffmpeg`
90
+ (required for MP4 output), `ffprobe` (required by `read-meta` on MP4 files) — in both
91
+ `README.md` and `docs/CLI.md`.
92
+
10
93
  ## [0.4.0] - 2026-03-28
11
94
 
12
95
  ### Added
dirplot-0.4.1/PKG-INFO ADDED
@@ -0,0 +1,130 @@
1
+ Metadata-Version: 2.4
2
+ Name: dirplot
3
+ Version: 0.4.1
4
+ Summary: Nested treemap visualizations for directory trees and archives
5
+ Project-URL: Repository, https://github.com/deeplook/dirplot
6
+ License: MIT
7
+ License-File: LICENSE
8
+ License-File: LICENSE2
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Environment :: Console
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Intended Audience :: System Administrators
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3.14
22
+ Classifier: Topic :: Scientific/Engineering :: Visualization
23
+ Classifier: Topic :: System :: Archiving
24
+ Classifier: Topic :: System :: Filesystems
25
+ Classifier: Topic :: Terminals
26
+ Classifier: Topic :: Utilities
27
+ Classifier: Typing :: Typed
28
+ Requires-Python: >=3.10
29
+ Requires-Dist: drawsvg>=2.4.1
30
+ Requires-Dist: matplotlib>=3.7
31
+ Requires-Dist: pillow>=9.0
32
+ Requires-Dist: py7zr>=0.20
33
+ Requires-Dist: rarfile>=4.0
34
+ Requires-Dist: squarify>=0.4
35
+ Requires-Dist: typer>=0.9
36
+ Requires-Dist: watchdog>=6.0.0
37
+ Provides-Extra: dev
38
+ Requires-Dist: mypy>=1.10; extra == 'dev'
39
+ Requires-Dist: pre-commit>=3.0; extra == 'dev'
40
+ Requires-Dist: pytest-cov>=5.0; extra == 'dev'
41
+ Requires-Dist: pytest>=8.0; extra == 'dev'
42
+ Requires-Dist: ruff>=0.4; extra == 'dev'
43
+ Provides-Extra: libarchive
44
+ Requires-Dist: libarchive-c>=5.0; extra == 'libarchive'
45
+ Provides-Extra: s3
46
+ Requires-Dist: boto3>=1.26; extra == 's3'
47
+ Provides-Extra: ssh
48
+ Requires-Dist: paramiko>=3.0; extra == 'ssh'
49
+ Description-Content-Type: text/markdown
50
+
51
+ # dirplot
52
+
53
+ [![CI](https://github.com/deeplook/dirplot/actions/workflows/ci.yml/badge.svg)](https://github.com/deeplook/dirplot/actions/workflows/ci.yml)
54
+ [![PyPI](https://img.shields.io/pypi/v/dirplot.svg)](https://pypi.org/project/dirplot/)
55
+ [![Python](https://img.shields.io/pypi/pyversions/dirplot.svg)](https://pypi.org/project/dirplot/)
56
+ [![Downloads](https://img.shields.io/pypi/dm/dirplot.svg)](https://pepy.tech/project/dirplot)
57
+ [![License](https://img.shields.io/pypi/l/dirplot.svg)](https://pypi.org/project/dirplot/)
58
+ [![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)
59
+
60
+ **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.
61
+
62
+ ![dirplot output](https://raw.githubusercontent.com/deeplook/dirplot/main/docs/dirplot.png)
63
+
64
+ ## Features
65
+
66
+ - Squarified treemap layout; file area proportional to size; ~500 extensions mapped to [GitHub Linguist](https://github.com/github/linguist) colours.
67
+ - PNG and interactive SVG output; renders at terminal pixel size or a custom `WIDTHxHEIGHT`.
68
+ - **Animate git history** (`dirplot git`), **watch live filesystems** (`dirplot watch`), and **replay event logs** (`dirplot replay`) — all output APNG or MP4.
69
+ - Scan **SSH hosts**, **AWS S3**, **GitHub repos** (public and private), **Docker containers**, and **Kubernetes pods** — no extra deps beyond the respective CLI.
70
+ - Read **archives** directly (zip, tar, 7z, rar, jar, whl, …) without unpacking.
71
+ - Works on macOS, Linux, and Windows (WSL2 fully supported).
72
+
73
+ ## Installation
74
+
75
+ ```bash
76
+ # Standalone tool (recommended)
77
+ uv tool install dirplot
78
+
79
+ # Into the current environment
80
+ pip install dirplot
81
+ ```
82
+
83
+ Optional extras: `pip install "dirplot[ssh]"`, `"dirplot[s3]"`, `"dirplot[libarchive]"`.
84
+
85
+ `dirplot watch` uses [watchdog](https://github.com/gorakhargosh/watchdog) for filesystem monitoring — installed automatically as a dependency.
86
+
87
+ `dirplot git` requires `git` on `PATH`. MP4 output (`dirplot git`, `dirplot watch`, `dirplot replay` with `--animate`) requires [ffmpeg](https://ffmpeg.org/) on `PATH`. `dirplot read-meta` on `.mp4` files also requires `ffprobe` (bundled with ffmpeg).
88
+
89
+ ## Quick start
90
+
91
+ ```bash
92
+ dirplot map . # current directory
93
+ dirplot map . --inline # display in terminal
94
+ dirplot map . --output treemap.png --no-show # save to file
95
+ dirplot map . --log --inline # log scale, inline
96
+ dirplot map github://pallets/flask # GitHub repo
97
+ dirplot map docker://my-container:/app # Docker container
98
+ dirplot map project.zip # archive file
99
+ tree src/ | dirplot map # pipe tree output
100
+
101
+ dirplot git . -o history.mp4 --animate # full git history
102
+ dirplot git . -o history.mp4 --animate --last 30d # last 30 days
103
+ dirplot git github://owner/repo -o h.mp4 --animate --last 7d # GitHub, last week
104
+
105
+ dirplot watch . --output treemap.png # live watch
106
+ dirplot watch . --output treemap.mp4 --animate # record as MP4
107
+
108
+ dirplot demo # run examples, save to ./demo/
109
+ ```
110
+
111
+ ## Documentation
112
+
113
+ - [CLI reference](docs/CLI.md) — all commands, flags, and usage examples
114
+ - [Remote access](docs/EXAMPLES.md) — SSH, S3, GitHub, Docker, Kubernetes
115
+ - [Archives](docs/ARCHIVES.md) — supported formats and dependencies
116
+ - [Python API](docs/API.md) — programmatic usage
117
+
118
+ ## Development
119
+
120
+ ```bash
121
+ git clone https://github.com/deeplook/dirplot
122
+ cd dirplot
123
+ make test
124
+ ```
125
+
126
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for full details.
127
+
128
+ ## License
129
+
130
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,80 @@
1
+ # dirplot
2
+
3
+ [![CI](https://github.com/deeplook/dirplot/actions/workflows/ci.yml/badge.svg)](https://github.com/deeplook/dirplot/actions/workflows/ci.yml)
4
+ [![PyPI](https://img.shields.io/pypi/v/dirplot.svg)](https://pypi.org/project/dirplot/)
5
+ [![Python](https://img.shields.io/pypi/pyversions/dirplot.svg)](https://pypi.org/project/dirplot/)
6
+ [![Downloads](https://img.shields.io/pypi/dm/dirplot.svg)](https://pepy.tech/project/dirplot)
7
+ [![License](https://img.shields.io/pypi/l/dirplot.svg)](https://pypi.org/project/dirplot/)
8
+ [![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)
9
+
10
+ **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.
11
+
12
+ ![dirplot output](https://raw.githubusercontent.com/deeplook/dirplot/main/docs/dirplot.png)
13
+
14
+ ## Features
15
+
16
+ - Squarified treemap layout; file area proportional to size; ~500 extensions mapped to [GitHub Linguist](https://github.com/github/linguist) colours.
17
+ - PNG and interactive SVG output; renders at terminal pixel size or a custom `WIDTHxHEIGHT`.
18
+ - **Animate git history** (`dirplot git`), **watch live filesystems** (`dirplot watch`), and **replay event logs** (`dirplot replay`) — all output APNG or MP4.
19
+ - Scan **SSH hosts**, **AWS S3**, **GitHub repos** (public and private), **Docker containers**, and **Kubernetes pods** — no extra deps beyond the respective CLI.
20
+ - Read **archives** directly (zip, tar, 7z, rar, jar, whl, …) without unpacking.
21
+ - Works on macOS, Linux, and Windows (WSL2 fully supported).
22
+
23
+ ## Installation
24
+
25
+ ```bash
26
+ # Standalone tool (recommended)
27
+ uv tool install dirplot
28
+
29
+ # Into the current environment
30
+ pip install dirplot
31
+ ```
32
+
33
+ Optional extras: `pip install "dirplot[ssh]"`, `"dirplot[s3]"`, `"dirplot[libarchive]"`.
34
+
35
+ `dirplot watch` uses [watchdog](https://github.com/gorakhargosh/watchdog) for filesystem monitoring — installed automatically as a dependency.
36
+
37
+ `dirplot git` requires `git` on `PATH`. MP4 output (`dirplot git`, `dirplot watch`, `dirplot replay` with `--animate`) requires [ffmpeg](https://ffmpeg.org/) on `PATH`. `dirplot read-meta` on `.mp4` files also requires `ffprobe` (bundled with ffmpeg).
38
+
39
+ ## Quick start
40
+
41
+ ```bash
42
+ dirplot map . # current directory
43
+ dirplot map . --inline # display in terminal
44
+ dirplot map . --output treemap.png --no-show # save to file
45
+ dirplot map . --log --inline # log scale, inline
46
+ dirplot map github://pallets/flask # GitHub repo
47
+ dirplot map docker://my-container:/app # Docker container
48
+ dirplot map project.zip # archive file
49
+ tree src/ | dirplot map # pipe tree output
50
+
51
+ dirplot git . -o history.mp4 --animate # full git history
52
+ dirplot git . -o history.mp4 --animate --last 30d # last 30 days
53
+ dirplot git github://owner/repo -o h.mp4 --animate --last 7d # GitHub, last week
54
+
55
+ dirplot watch . --output treemap.png # live watch
56
+ dirplot watch . --output treemap.mp4 --animate # record as MP4
57
+
58
+ dirplot demo # run examples, save to ./demo/
59
+ ```
60
+
61
+ ## Documentation
62
+
63
+ - [CLI reference](docs/CLI.md) — all commands, flags, and usage examples
64
+ - [Remote access](docs/EXAMPLES.md) — SSH, S3, GitHub, Docker, Kubernetes
65
+ - [Archives](docs/ARCHIVES.md) — supported formats and dependencies
66
+ - [Python API](docs/API.md) — programmatic usage
67
+
68
+ ## Development
69
+
70
+ ```bash
71
+ git clone https://github.com/deeplook/dirplot
72
+ cd dirplot
73
+ make test
74
+ ```
75
+
76
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for full details.
77
+
78
+ ## License
79
+
80
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,72 @@
1
+ # Python API
2
+
3
+ > **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.
4
+
5
+ The public API centres on `build_tree`, `create_treemap`, and `create_treemap_svg`:
6
+
7
+ ```python
8
+ from pathlib import Path
9
+ from dirplot import build_tree, create_treemap, create_treemap_svg
10
+
11
+ root = build_tree(Path("/path/to/project"))
12
+
13
+ # PNG — returns a BytesIO containing PNG bytes
14
+ buf = create_treemap(root, width_px=1920, height_px=1080, colormap="tab20", cushion=True)
15
+ Path("treemap.png").write_bytes(buf.read())
16
+
17
+ # SVG — returns a BytesIO containing UTF-8 SVG bytes
18
+ # Includes CSS hover highlight, a JS floating tooltip, and cushion gradient shading.
19
+ buf = create_treemap_svg(root, width_px=1920, height_px=1080, cushion=True)
20
+ Path("treemap.svg").write_bytes(buf.read())
21
+ ```
22
+
23
+ To open a PNG in the system image viewer or display it inline in the terminal:
24
+
25
+ ```python
26
+ from dirplot.display import display_window, display_inline
27
+
28
+ buf.seek(0)
29
+ display_window(buf) # system viewer (works everywhere)
30
+
31
+ buf.seek(0)
32
+ display_inline(buf) # inline in terminal (iTerm2 / Kitty / WezTerm)
33
+ ```
34
+
35
+ In a Jupyter notebook, PNG output renders automatically via PIL:
36
+
37
+ ```python
38
+ from PIL import Image
39
+ buf = create_treemap(root, width_px=1280, height_px=720)
40
+ Image.open(buf) # Jupyter renders PIL images automatically via _repr_png_()
41
+ ```
42
+
43
+ ## Remote backends
44
+
45
+ Each remote backend exposes a `build_tree_*` function that returns the same `Node` type accepted by `create_treemap`:
46
+
47
+ ```python
48
+ # GitHub
49
+ from dirplot.github import build_tree_github
50
+ root, branch = build_tree_github("pallets", "flask", token="ghp_…", depth=4)
51
+
52
+ # SSH
53
+ from dirplot.ssh import connect, build_tree_ssh
54
+ client = connect("prod.example.com", "alice", ssh_key="~/.ssh/prod_key")
55
+ sftp = client.open_sftp()
56
+ root = build_tree_ssh(sftp, "/var/www", depth=5)
57
+ sftp.close(); client.close()
58
+
59
+ # S3
60
+ from dirplot.s3 import make_s3_client, build_tree_s3
61
+ s3 = make_s3_client(profile="prod") # authenticated
62
+ s3 = make_s3_client(no_sign=True) # public bucket
63
+ root = build_tree_s3(s3, "my-bucket", "path/to/prefix/", depth=5)
64
+
65
+ # Docker
66
+ from dirplot.docker import build_tree_docker
67
+ root = build_tree_docker("my-container", "/app", depth=5)
68
+
69
+ # Kubernetes
70
+ from dirplot.k8s import build_tree_pod
71
+ root = build_tree_pod("my-pod", "/app", namespace="staging", container="main", depth=5)
72
+ ```