dirplot 0.3.1__tar.gz → 0.3.2__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 (147) hide show
  1. {dirplot-0.3.1 → dirplot-0.3.2}/CHANGELOG.md +40 -0
  2. {dirplot-0.3.1 → dirplot-0.3.2}/PKG-INFO +13 -3
  3. {dirplot-0.3.1 → dirplot-0.3.2}/README.md +11 -2
  4. dirplot-0.3.2/alpine-pod.png +0 -0
  5. dirplot-0.3.2/aws-lambda.png +0 -0
  6. dirplot-0.3.2/demo.cast +418 -0
  7. dirplot-0.3.2/demo.yaml +26 -0
  8. dirplot-0.3.2/demo.yaml~ +16 -0
  9. dirplot-0.3.2/demo1.cast +414 -0
  10. dirplot-0.3.2/docs/docker.png +0 -0
  11. dirplot-0.3.2/docs/fastapi.png +0 -0
  12. dirplot-0.3.2/docs/flask.png +0 -0
  13. dirplot-0.3.2/docs/k8s.png +0 -0
  14. dirplot-0.3.2/docs/pypy.png +0 -0
  15. dirplot-0.3.2/docs/python.png +0 -0
  16. dirplot-0.3.2/docs/s3.png +0 -0
  17. dirplot-0.3.2/foo.svg +158 -0
  18. dirplot-0.3.2/gen_asciicast.py +306 -0
  19. dirplot-0.3.2/misc/scan/FILE-SCANNING.md +72 -0
  20. dirplot-0.3.2/misc/scan/compare.py +58 -0
  21. dirplot-0.3.2/misc/scan/scan_async.py +93 -0
  22. dirplot-0.3.2/misc/scan/scan_dir.py +66 -0
  23. dirplot-0.3.2/misc/scan/scan_rust.py +33 -0
  24. dirplot-0.3.2/misc/scan/scan_threaded.py +90 -0
  25. dirplot-0.3.2/misc/scan/scan_walk.py +46 -0
  26. dirplot-0.3.2/misc/watch/foo.txt +2 -0
  27. dirplot-0.3.2/misc/watch/watch_dir.py +72 -0
  28. dirplot-0.3.2/misc/watch/wordcloud1.png +0 -0
  29. dirplot-0.3.2/misc-watched.png +0 -0
  30. dirplot-0.3.2/openclaw.png +0 -0
  31. dirplot-0.3.2/pg.png +0 -0
  32. {dirplot-0.3.1 → dirplot-0.3.2}/pyproject.toml +3 -1
  33. dirplot-0.3.2/scripts/animate_demo.py +121 -0
  34. {dirplot-0.3.1 → dirplot-0.3.2}/scripts/make_docs_images.sh +1 -1
  35. {dirplot-0.3.1 → dirplot-0.3.2}/src/dirplot/docker.py +1 -1
  36. {dirplot-0.3.1 → dirplot-0.3.2}/src/dirplot/k8s.py +11 -1
  37. {dirplot-0.3.1 → dirplot-0.3.2}/src/dirplot/main.py +239 -15
  38. {dirplot-0.3.1 → dirplot-0.3.2}/src/dirplot/render.py +96 -16
  39. {dirplot-0.3.1 → dirplot-0.3.2}/src/dirplot/scanner.py +82 -0
  40. {dirplot-0.3.1 → dirplot-0.3.2}/src/dirplot/svg_render.py +22 -4
  41. dirplot-0.3.2/src/dirplot/watch.py +168 -0
  42. dirplot-0.3.2/src-portrait.png +0 -0
  43. dirplot-0.3.2/src.pdf +0 -0
  44. dirplot-0.3.2/src.png +0 -0
  45. dirplot-0.3.2/src.svg +382 -0
  46. dirplot-0.3.2/test-animation.png +0 -0
  47. dirplot-0.3.2/tests/animation/README.md +3 -0
  48. dirplot-0.3.2/tests/animation/changelog.txt +1 -0
  49. dirplot-0.3.2/tests/animation/config.toml +3 -0
  50. dirplot-0.3.2/tests/animation/data/records.csv +4 -0
  51. dirplot-0.3.2/tests/animation/data/schema_v1.json +1 -0
  52. dirplot-0.3.2/tests/animation/src/lib/parser.py +2 -0
  53. dirplot-0.3.2/tests/animation/src/main.py +7 -0
  54. {dirplot-0.3.1 → dirplot-0.3.2}/tests/test_cli.py +58 -3
  55. {dirplot-0.3.1 → dirplot-0.3.2}/tests/test_render.py +52 -1
  56. {dirplot-0.3.1 → dirplot-0.3.2}/tests/test_scanner.py +92 -1
  57. {dirplot-0.3.1 → dirplot-0.3.2}/tests/test_svg_render.py +49 -0
  58. {dirplot-0.3.1 → dirplot-0.3.2}/uv.lock +35 -1
  59. dirplot-0.3.1/docs/docker.png +0 -0
  60. dirplot-0.3.1/docs/fastapi.png +0 -0
  61. dirplot-0.3.1/docs/flask.png +0 -0
  62. dirplot-0.3.1/docs/k8s.png +0 -0
  63. dirplot-0.3.1/docs/pypy.png +0 -0
  64. dirplot-0.3.1/docs/python.png +0 -0
  65. dirplot-0.3.1/docs/s3.png +0 -0
  66. dirplot-0.3.1/src.svg +0 -370
  67. {dirplot-0.3.1 → dirplot-0.3.2}/.claude/settings.local.json +0 -0
  68. {dirplot-0.3.1 → dirplot-0.3.2}/.dockerignore +0 -0
  69. {dirplot-0.3.1 → dirplot-0.3.2}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  70. {dirplot-0.3.1 → dirplot-0.3.2}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  71. {dirplot-0.3.1 → dirplot-0.3.2}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  72. {dirplot-0.3.1 → dirplot-0.3.2}/.github/dependabot.yml +0 -0
  73. {dirplot-0.3.1 → dirplot-0.3.2}/.github/workflows/ci.yml +0 -0
  74. {dirplot-0.3.1 → dirplot-0.3.2}/.github/workflows/publish.yml +0 -0
  75. {dirplot-0.3.1 → dirplot-0.3.2}/.gitignore +0 -0
  76. {dirplot-0.3.1 → dirplot-0.3.2}/.ipynb_checkpoints/Untitled-checkpoint.ipynb +0 -0
  77. {dirplot-0.3.1 → dirplot-0.3.2}/.pre-commit-config.yaml +0 -0
  78. {dirplot-0.3.1 → dirplot-0.3.2}/.python-version +0 -0
  79. {dirplot-0.3.1 → dirplot-0.3.2}/CONTRIBUTING.md +0 -0
  80. {dirplot-0.3.1 → dirplot-0.3.2}/Dockerfile +0 -0
  81. {dirplot-0.3.1 → dirplot-0.3.2}/LICENSE +0 -0
  82. {dirplot-0.3.1 → dirplot-0.3.2}/Makefile +0 -0
  83. {dirplot-0.3.1 → dirplot-0.3.2}/SECURITY.md +0 -0
  84. {dirplot-0.3.1 → dirplot-0.3.2}/TASKS.md~ +0 -0
  85. {dirplot-0.3.1 → dirplot-0.3.2}/docs/ARCHIVES.md +0 -0
  86. {dirplot-0.3.1 → dirplot-0.3.2}/docs/EXAMPLES.md +0 -0
  87. {dirplot-0.3.1 → dirplot-0.3.2}/docs/SSH_DESIGN.md +0 -0
  88. {dirplot-0.3.1 → dirplot-0.3.2}/docs/dirplot.png +0 -0
  89. {dirplot-0.3.1 → dirplot-0.3.2}/scripts/make_fixtures.py +0 -0
  90. {dirplot-0.3.1 → dirplot-0.3.2}/scripts/open_terminals.sh +0 -0
  91. {dirplot-0.3.1 → dirplot-0.3.2}/src/dirplot/__init__.py +0 -0
  92. {dirplot-0.3.1 → dirplot-0.3.2}/src/dirplot/__main__.py +0 -0
  93. {dirplot-0.3.1 → dirplot-0.3.2}/src/dirplot/archives.py +0 -0
  94. {dirplot-0.3.1 → dirplot-0.3.2}/src/dirplot/colors.py +0 -0
  95. {dirplot-0.3.1 → dirplot-0.3.2}/src/dirplot/display.py +0 -0
  96. {dirplot-0.3.1 → dirplot-0.3.2}/src/dirplot/fonts/JetBrainsMono-Bold.ttf +0 -0
  97. {dirplot-0.3.1 → dirplot-0.3.2}/src/dirplot/fonts/JetBrainsMono-BoldItalic.ttf +0 -0
  98. {dirplot-0.3.1 → dirplot-0.3.2}/src/dirplot/fonts/JetBrainsMono-Italic.ttf +0 -0
  99. {dirplot-0.3.1 → dirplot-0.3.2}/src/dirplot/fonts/JetBrainsMono-Regular.ttf +0 -0
  100. {dirplot-0.3.1 → dirplot-0.3.2}/src/dirplot/fonts/OFL.txt +0 -0
  101. {dirplot-0.3.1 → dirplot-0.3.2}/src/dirplot/github.py +0 -0
  102. {dirplot-0.3.1 → dirplot-0.3.2}/src/dirplot/py.typed +0 -0
  103. {dirplot-0.3.1 → dirplot-0.3.2}/src/dirplot/s3.py +0 -0
  104. {dirplot-0.3.1 → dirplot-0.3.2}/src/dirplot/ssh.py +0 -0
  105. {dirplot-0.3.1 → dirplot-0.3.2}/src/dirplot/terminal.py +0 -0
  106. {dirplot-0.3.1 → dirplot-0.3.2}/tests/__init__.py +0 -0
  107. {dirplot-0.3.1 → dirplot-0.3.2}/tests/conftest.py +0 -0
  108. {dirplot-0.3.1 → dirplot-0.3.2}/tests/example/bar/bar.py +0 -0
  109. {dirplot-0.3.1 → dirplot-0.3.2}/tests/example/bar/baz.json +0 -0
  110. {dirplot-0.3.1 → dirplot-0.3.2}/tests/example/foo/foo.md +0 -0
  111. {dirplot-0.3.1 → dirplot-0.3.2}/tests/fixtures/sample.7z +0 -0
  112. {dirplot-0.3.1 → dirplot-0.3.2}/tests/fixtures/sample.a +0 -0
  113. {dirplot-0.3.1 → dirplot-0.3.2}/tests/fixtures/sample.aab +0 -0
  114. {dirplot-0.3.1 → dirplot-0.3.2}/tests/fixtures/sample.apk +0 -0
  115. {dirplot-0.3.1 → dirplot-0.3.2}/tests/fixtures/sample.cpio +0 -0
  116. {dirplot-0.3.1 → dirplot-0.3.2}/tests/fixtures/sample.ear +0 -0
  117. {dirplot-0.3.1 → dirplot-0.3.2}/tests/fixtures/sample.epub +0 -0
  118. {dirplot-0.3.1 → dirplot-0.3.2}/tests/fixtures/sample.ipa +0 -0
  119. {dirplot-0.3.1 → dirplot-0.3.2}/tests/fixtures/sample.iso +0 -0
  120. {dirplot-0.3.1 → dirplot-0.3.2}/tests/fixtures/sample.jar +0 -0
  121. {dirplot-0.3.1 → dirplot-0.3.2}/tests/fixtures/sample.nupkg +0 -0
  122. {dirplot-0.3.1 → dirplot-0.3.2}/tests/fixtures/sample.rar +0 -0
  123. {dirplot-0.3.1 → dirplot-0.3.2}/tests/fixtures/sample.tar +0 -0
  124. {dirplot-0.3.1 → dirplot-0.3.2}/tests/fixtures/sample.tar.bz2 +0 -0
  125. {dirplot-0.3.1 → dirplot-0.3.2}/tests/fixtures/sample.tar.gz +0 -0
  126. {dirplot-0.3.1 → dirplot-0.3.2}/tests/fixtures/sample.tar.xz +0 -0
  127. {dirplot-0.3.1 → dirplot-0.3.2}/tests/fixtures/sample.tar.zst +0 -0
  128. {dirplot-0.3.1 → dirplot-0.3.2}/tests/fixtures/sample.tbz2 +0 -0
  129. {dirplot-0.3.1 → dirplot-0.3.2}/tests/fixtures/sample.tgz +0 -0
  130. {dirplot-0.3.1 → dirplot-0.3.2}/tests/fixtures/sample.txz +0 -0
  131. {dirplot-0.3.1 → dirplot-0.3.2}/tests/fixtures/sample.tzst +0 -0
  132. {dirplot-0.3.1 → dirplot-0.3.2}/tests/fixtures/sample.vsix +0 -0
  133. {dirplot-0.3.1 → dirplot-0.3.2}/tests/fixtures/sample.war +0 -0
  134. {dirplot-0.3.1 → dirplot-0.3.2}/tests/fixtures/sample.whl +0 -0
  135. {dirplot-0.3.1 → dirplot-0.3.2}/tests/fixtures/sample.xar +0 -0
  136. {dirplot-0.3.1 → dirplot-0.3.2}/tests/fixtures/sample.xpi +0 -0
  137. {dirplot-0.3.1 → dirplot-0.3.2}/tests/fixtures/sample.zip +0 -0
  138. {dirplot-0.3.1 → dirplot-0.3.2}/tests/test_archives.py +0 -0
  139. {dirplot-0.3.1 → dirplot-0.3.2}/tests/test_colors.py +0 -0
  140. {dirplot-0.3.1 → dirplot-0.3.2}/tests/test_display.py +0 -0
  141. {dirplot-0.3.1 → dirplot-0.3.2}/tests/test_docker.py +0 -0
  142. {dirplot-0.3.1 → dirplot-0.3.2}/tests/test_drawing.py +0 -0
  143. {dirplot-0.3.1 → dirplot-0.3.2}/tests/test_github.py +0 -0
  144. {dirplot-0.3.1 → dirplot-0.3.2}/tests/test_k8s.py +0 -0
  145. {dirplot-0.3.1 → dirplot-0.3.2}/tests/test_s3.py +0 -0
  146. {dirplot-0.3.1 → dirplot-0.3.2}/tests/test_ssh.py +0 -0
  147. {dirplot-0.3.1 → dirplot-0.3.2}/tests/test_terminal.py +0 -0
@@ -7,6 +7,46 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.3.2] - 2026-03-13
11
+
12
+ ### Added
13
+
14
+ - **`dirplot watch`** subcommand — watches a directory and regenerates the treemap
15
+ on every file-system change using watchdog (FSEvents on macOS, inotify on Linux,
16
+ kqueue on BSD). Requires `watchdog`, now a core dependency.
17
+ ```bash
18
+ dirplot watch . --output treemap.png
19
+ dirplot watch . --output treemap.png --animate # APNG, one frame per change
20
+ ```
21
+ - **Vertical file labels**: file tiles that are at least twice as tall as wide now
22
+ display their label rotated 90° CCW, letting the text span the full tile height
23
+ instead of being squeezed into the narrow width.
24
+ - **Scan and render timing** shown in header output:
25
+ `Found 1,414 files … [2.3s]` and `Saved dirplot to out.png [0.4s]`.
26
+ - **Multiple local roots**: `dirplot map src tests` accepts two or more local
27
+ directory paths, finds their common parent, and shows only those subtrees.
28
+ - **`--subtree` / `-s`** option (repeatable) — allowlist complement to `--exclude`:
29
+ keep only the named direct children of the root after scanning. Supports nested
30
+ paths such as `--subtree src/dirplot/fonts`.
31
+
32
+ ### Fixed
33
+
34
+ - `--exclude` on pod and Docker backends now prunes entire subtrees — previously only
35
+ the exact path was matched, so all children leaked through.
36
+ - Clearer error for distroless pods: exit code 126 from `kubectl exec` now surfaces as
37
+ an actionable message explaining that the container has no shell or `find` utility.
38
+ - Adaptive file-label font size is now computed with a single `textbbox` measurement
39
+ (one call per tile) instead of stepping down one pixel at a time — eliminates an
40
+ O(font_size × n_tiles) bottleneck that caused near-blocking on large trees such as
41
+ `.venv` directories.
42
+
43
+ ### Changed
44
+
45
+ - `-s` short alias reassigned from `--font-size` to `--subtree`. `--font-size` still
46
+ works as before; it just no longer has a single-letter alias.
47
+
48
+ ## [0.3.1] - 2026-03-11
49
+
10
50
  ### Added
11
51
 
12
52
  - `github://` URI now accepts an optional subpath after the repository name, letting
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dirplot
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: Static treemap bitmaps for directory trees and archives, displayed as inline terminal images
5
5
  Project-URL: Repository, https://github.com/deeplook/dirplot
6
6
  License: MIT
@@ -33,6 +33,7 @@ Requires-Dist: py7zr>=0.20
33
33
  Requires-Dist: rarfile>=4.0
34
34
  Requires-Dist: squarify>=0.4
35
35
  Requires-Dist: typer>=0.9
36
+ Requires-Dist: watchdog>=6.0.0
36
37
  Provides-Extra: dev
37
38
  Requires-Dist: mypy>=1.10; extra == 'dev'
38
39
  Requires-Dist: pre-commit>=3.0; extra == 'dev'
@@ -72,7 +73,8 @@ Description-Content-Type: text/markdown
72
73
  - **SVG output** (`--format svg` or `--output file.svg`) produces a fully self-contained interactive file: CSS hover highlight, a JavaScript floating tooltip panel, and cushion shading via a gradient — no external dependencies.
73
74
  - Display via system image viewer or inline in the terminal (iTerm2 and Kitty protocols, auto-detected).
74
75
  - Save output to a PNG or SVG file with `--output`.
75
- - Exclude paths with `--exclude` (repeatable).
76
+ - Exclude paths with `--exclude` (repeatable), or focus on specific subtrees with `--subtree` / `-s` (allowlist complement, supports nested paths like `src/dirplot/fonts`).
77
+ - Pass multiple local paths (`dirplot map src tests`) to scan each independently and display them under their common parent, ignoring all other siblings.
76
78
  - Works on macOS, Linux, and Windows; WSL2 fully supported.
77
79
  - Scan remote hosts over SSH (`pip install "dirplot[ssh]"`), AWS S3 buckets (`pip install "dirplot[s3]"`), any public/private GitHub repository (including specific branch, tag, commit SHA, or subdirectory), **running Docker containers**, or **Kubernetes pods** — all without extra dependencies beyond the respective CLI/SDK. See [EXAMPLES.md](docs/EXAMPLES.md).
78
80
  - Optional **file-count legend** (`--legend`) — a corner overlay listing the top extensions by number of files, with coloured swatches and counts, automatically sized to fit the image.
@@ -134,6 +136,13 @@ dirplot map . --inline
134
136
  # Exclude directories
135
137
  dirplot map . --exclude .venv --exclude .git
136
138
 
139
+ # Map two specific subtrees under their common parent
140
+ dirplot map src tests
141
+
142
+ # Focus on named subtrees of a root (allowlist; supports nested paths)
143
+ dirplot map . --subtree src --subtree tests
144
+ dirplot map . --subtree src/dirplot/fonts
145
+
137
146
  # Use a different colormap and larger directory labels
138
147
  dirplot map . --colormap Set2 --font-size 18
139
148
 
@@ -165,9 +174,10 @@ dirplot map . --format svg --output treemap.svg --no-show
165
174
  | `--show/--no-show` | | `--show` | Display the image after rendering |
166
175
  | `--inline` | | off | Display in terminal (protocol auto-detected; PNG only) |
167
176
  | `--legend [N]` | | off | Show file-count legend; `N` sets max entries (default: 20) |
168
- | `--font-size` | `-s` | `12` | Directory label font size in pixels |
177
+ | `--font-size` | | `12` | Directory label font size in pixels |
169
178
  | `--colormap` | `-c` | `tab20` | Matplotlib colormap for unknown extensions |
170
179
  | `--exclude` | `-e` | — | Path to exclude (repeatable) |
180
+ | `--subtree` | `-s` | — | Show only this subtree of the root (repeatable); supports nested paths like `src/dirplot/fonts` |
171
181
  | `--size` | | terminal size | Output dimensions as `WIDTHxHEIGHT` (e.g. `1920x1080`) |
172
182
  | `--header/--no-header` | | `--header` | Print info lines before rendering |
173
183
  | `--cushion/--no-cushion` | | `--cushion` | Apply van Wijk cushion shading for a raised 3-D look |
@@ -23,7 +23,8 @@
23
23
  - **SVG output** (`--format svg` or `--output file.svg`) produces a fully self-contained interactive file: CSS hover highlight, a JavaScript floating tooltip panel, and cushion shading via a gradient — no external dependencies.
24
24
  - Display via system image viewer or inline in the terminal (iTerm2 and Kitty protocols, auto-detected).
25
25
  - Save output to a PNG or SVG file with `--output`.
26
- - Exclude paths with `--exclude` (repeatable).
26
+ - Exclude paths with `--exclude` (repeatable), or focus on specific subtrees with `--subtree` / `-s` (allowlist complement, supports nested paths like `src/dirplot/fonts`).
27
+ - Pass multiple local paths (`dirplot map src tests`) to scan each independently and display them under their common parent, ignoring all other siblings.
27
28
  - Works on macOS, Linux, and Windows; WSL2 fully supported.
28
29
  - Scan remote hosts over SSH (`pip install "dirplot[ssh]"`), AWS S3 buckets (`pip install "dirplot[s3]"`), any public/private GitHub repository (including specific branch, tag, commit SHA, or subdirectory), **running Docker containers**, or **Kubernetes pods** — all without extra dependencies beyond the respective CLI/SDK. See [EXAMPLES.md](docs/EXAMPLES.md).
29
30
  - Optional **file-count legend** (`--legend`) — a corner overlay listing the top extensions by number of files, with coloured swatches and counts, automatically sized to fit the image.
@@ -85,6 +86,13 @@ dirplot map . --inline
85
86
  # Exclude directories
86
87
  dirplot map . --exclude .venv --exclude .git
87
88
 
89
+ # Map two specific subtrees under their common parent
90
+ dirplot map src tests
91
+
92
+ # Focus on named subtrees of a root (allowlist; supports nested paths)
93
+ dirplot map . --subtree src --subtree tests
94
+ dirplot map . --subtree src/dirplot/fonts
95
+
88
96
  # Use a different colormap and larger directory labels
89
97
  dirplot map . --colormap Set2 --font-size 18
90
98
 
@@ -116,9 +124,10 @@ dirplot map . --format svg --output treemap.svg --no-show
116
124
  | `--show/--no-show` | | `--show` | Display the image after rendering |
117
125
  | `--inline` | | off | Display in terminal (protocol auto-detected; PNG only) |
118
126
  | `--legend [N]` | | off | Show file-count legend; `N` sets max entries (default: 20) |
119
- | `--font-size` | `-s` | `12` | Directory label font size in pixels |
127
+ | `--font-size` | | `12` | Directory label font size in pixels |
120
128
  | `--colormap` | `-c` | `tab20` | Matplotlib colormap for unknown extensions |
121
129
  | `--exclude` | `-e` | — | Path to exclude (repeatable) |
130
+ | `--subtree` | `-s` | — | Show only this subtree of the root (repeatable); supports nested paths like `src/dirplot/fonts` |
122
131
  | `--size` | | terminal size | Output dimensions as `WIDTHxHEIGHT` (e.g. `1920x1080`) |
123
132
  | `--header/--no-header` | | `--header` | Print info lines before rendering |
124
133
  | `--cushion/--no-cushion` | | `--cushion` | Apply van Wijk cushion shading for a raised 3-D look |
Binary file
Binary file