flexablelib 3.4.0__tar.gz → 3.5.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. {flexablelib-3.4.0 → flexablelib-3.5.1}/CHANGELOG.md +65 -0
  2. {flexablelib-3.4.0 → flexablelib-3.5.1}/PKG-INFO +42 -8
  3. {flexablelib-3.4.0 → flexablelib-3.5.1}/README.md +28 -1
  4. {flexablelib-3.4.0 → flexablelib-3.5.1}/flexablelib/_frames.py +34 -1
  5. flexablelib-3.5.1/flexablelib/_images.py +1288 -0
  6. {flexablelib-3.4.0 → flexablelib-3.5.1}/flexablelib/layout.py +19 -2
  7. {flexablelib-3.4.0 → flexablelib-3.5.1}/flexablelib.egg-info/PKG-INFO +42 -8
  8. {flexablelib-3.4.0 → flexablelib-3.5.1}/flexablelib.egg-info/SOURCES.txt +7 -1
  9. flexablelib-3.5.1/flexablelib.egg-info/requires.txt +35 -0
  10. {flexablelib-3.4.0 → flexablelib-3.5.1}/package.json +1 -1
  11. {flexablelib-3.4.0 → flexablelib-3.5.1}/setup.py +6 -1
  12. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v330_components.py +3 -1
  13. flexablelib-3.5.1/tests/test_v350_images.py +817 -0
  14. flexablelib-3.5.1/tests/test_v350_images_core.py +672 -0
  15. flexablelib-3.5.1/tools/bench_images.py +78 -0
  16. flexablelib-3.5.1/tools/image_demo.py +38 -0
  17. flexablelib-3.5.1/tools/wheel_check.py +85 -0
  18. flexablelib-3.4.0/flexablelib.egg-info/requires.txt +0 -26
  19. {flexablelib-3.4.0 → flexablelib-3.5.1}/.coveragerc +0 -0
  20. {flexablelib-3.4.0 → flexablelib-3.5.1}/LICENSE +0 -0
  21. {flexablelib-3.4.0 → flexablelib-3.5.1}/MANIFEST.in +0 -0
  22. {flexablelib-3.4.0 → flexablelib-3.5.1}/examples/admin.py +0 -0
  23. {flexablelib-3.4.0 → flexablelib-3.5.1}/examples/dashboard.py +0 -0
  24. {flexablelib-3.4.0 → flexablelib-3.5.1}/examples/keys.py +0 -0
  25. {flexablelib-3.4.0 → flexablelib-3.5.1}/flexablelib/__init__.py +0 -0
  26. {flexablelib-3.4.0 → flexablelib-3.5.1}/flexablelib/_legacy/__init__.py +0 -0
  27. {flexablelib-3.4.0 → flexablelib-3.5.1}/flexablelib/_legacy/screen.py +0 -0
  28. {flexablelib-3.4.0 → flexablelib-3.5.1}/flexablelib/_legacy/widgets.py +0 -0
  29. {flexablelib-3.4.0 → flexablelib-3.5.1}/flexablelib/_speedups.c +0 -0
  30. {flexablelib-3.4.0 → flexablelib-3.5.1}/flexablelib/_width_tables.h +0 -0
  31. {flexablelib-3.4.0 → flexablelib-3.5.1}/flexablelib/box_topology.py +0 -0
  32. {flexablelib-3.4.0 → flexablelib-3.5.1}/flexablelib/cells.py +0 -0
  33. {flexablelib-3.4.0 → flexablelib-3.5.1}/flexablelib/colors.py +0 -0
  34. {flexablelib-3.4.0 → flexablelib-3.5.1}/flexablelib/columns.py +0 -0
  35. {flexablelib-3.4.0 → flexablelib-3.5.1}/flexablelib/fast.py +0 -0
  36. {flexablelib-3.4.0 → flexablelib-3.5.1}/flexablelib/identifiers.py +0 -0
  37. {flexablelib-3.4.0 → flexablelib-3.5.1}/flexablelib/merges.py +0 -0
  38. {flexablelib-3.4.0 → flexablelib-3.5.1}/flexablelib/options.py +0 -0
  39. {flexablelib-3.4.0 → flexablelib-3.5.1}/flexablelib/py.typed +0 -0
  40. {flexablelib-3.4.0 → flexablelib-3.5.1}/flexablelib/readers.py +0 -0
  41. {flexablelib-3.4.0 → flexablelib-3.5.1}/flexablelib/screen.py +0 -0
  42. {flexablelib-3.4.0 → flexablelib-3.5.1}/flexablelib/style_compositions.py +0 -0
  43. {flexablelib-3.4.0 → flexablelib-3.5.1}/flexablelib/table.py +0 -0
  44. {flexablelib-3.4.0 → flexablelib-3.5.1}/flexablelib/table_strings.py +0 -0
  45. {flexablelib-3.4.0 → flexablelib-3.5.1}/flexablelib/text_width.py +0 -0
  46. {flexablelib-3.4.0 → flexablelib-3.5.1}/flexablelib/utils.py +0 -0
  47. {flexablelib-3.4.0 → flexablelib-3.5.1}/flexablelib/widgets.py +0 -0
  48. {flexablelib-3.4.0 → flexablelib-3.5.1}/flexablelib/writers.py +0 -0
  49. {flexablelib-3.4.0 → flexablelib-3.5.1}/flexablelib.egg-info/dependency_links.txt +0 -0
  50. {flexablelib-3.4.0 → flexablelib-3.5.1}/flexablelib.egg-info/top_level.txt +0 -0
  51. {flexablelib-3.4.0 → flexablelib-3.5.1}/pytest.ini +0 -0
  52. {flexablelib-3.4.0 → flexablelib-3.5.1}/setup.cfg +0 -0
  53. {flexablelib-3.4.0 → flexablelib-3.5.1}/style_examples.md +0 -0
  54. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/conftest.py +0 -0
  55. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/helpers.py +0 -0
  56. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_align_indicators.py +0 -0
  57. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_box_topology.py +0 -0
  58. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_cells.py +0 -0
  59. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_columns.py +0 -0
  60. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_excel.py +0 -0
  61. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_features.py +0 -0
  62. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_issues.py +0 -0
  63. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_merge_edge_matrix.py +0 -0
  64. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_merge_fill.py +0 -0
  65. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_merges.py +0 -0
  66. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_public_api_edges.py +0 -0
  67. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_readme_examples.py +0 -0
  68. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_stress_matrix.py +0 -0
  69. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_style_line_widths.py +0 -0
  70. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_styles.py +0 -0
  71. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_text_width.py +0 -0
  72. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_two_pass_measurement.py +0 -0
  73. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_upstream_issues.py +0 -0
  74. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v2021_fixes.py +0 -0
  75. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v210_rows_copy.py +0 -0
  76. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v2110_fixes.py +0 -0
  77. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v211_fixes.py +0 -0
  78. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v213_features.py +0 -0
  79. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v214_features.py +0 -0
  80. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v215_features.py +0 -0
  81. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v216_features.py +0 -0
  82. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v217_features.py +0 -0
  83. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v218_features.py +0 -0
  84. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v219_coverage.py +0 -0
  85. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v219_fixes.py +0 -0
  86. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v220_exports.py +0 -0
  87. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v221_fixes.py +0 -0
  88. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v222_fixes.py +0 -0
  89. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v223_fixes.py +0 -0
  90. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v224_fixes.py +0 -0
  91. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v230_none.py +0 -0
  92. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v231_fixes.py +0 -0
  93. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v232_merge_ansi.py +0 -0
  94. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v300_style_names.py +0 -0
  95. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v310_layout.py +0 -0
  96. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v320_tui.py +0 -0
  97. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v330_frames.py +0 -0
  98. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v330_layout.py +0 -0
  99. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v330_tui.py +0 -0
  100. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v331_formats.py +0 -0
  101. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v331_panel_width.py +0 -0
  102. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v331_readers_bom.py +0 -0
  103. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v331_readers_edges.py +0 -0
  104. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v331_tabs.py +0 -0
  105. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v340_accessibility.py +0 -0
  106. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v340_core.py +0 -0
  107. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/test_v340_input.py +0 -0
  108. {flexablelib-3.4.0 → flexablelib-3.5.1}/tests/wincon_child.py +0 -0
  109. {flexablelib-3.4.0 → flexablelib-3.5.1}/tools/bench_frames.py +0 -0
  110. {flexablelib-3.4.0 → flexablelib-3.5.1}/tools/benchmark.py +0 -0
  111. {flexablelib-3.4.0 → flexablelib-3.5.1}/tools/gen_ascii_table.py +0 -0
  112. {flexablelib-3.4.0 → flexablelib-3.5.1}/tools/generate_width_tables.py +0 -0
  113. {flexablelib-3.4.0 → flexablelib-3.5.1}/tools/pty_check.py +0 -0
  114. {flexablelib-3.4.0 → flexablelib-3.5.1}/tools/readme_gallery.py +0 -0
  115. {flexablelib-3.4.0 → flexablelib-3.5.1}/tools/stress_matrix.py +0 -0
  116. {flexablelib-3.4.0 → flexablelib-3.5.1}/tools/style_examples.py +0 -0
  117. {flexablelib-3.4.0 → flexablelib-3.5.1}/tools/text_to_png.py +0 -0
@@ -2,6 +2,71 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [3.5.1] - 2026-11-12
6
+
7
+ ### Added
8
+ - **Linux aarch64 (arm64) wheels** for `flexablelib` and
9
+ `flexablelib-speedups`, glibc (manylinux) and musl (musllinux/Alpine),
10
+ CPython 3.8–3.14, built and tested on native arm64 runners.
11
+ - **macOS Intel (x86_64) wheels** for both projects, CPython 3.8–3.14.
12
+ - Every wheel is checked on its own architecture by `tools/wheel_check.py`:
13
+ the C extension loads and matches the pure Python code (text measurement,
14
+ frame primitives, picture resize/quantize/sixel/blocks) on random input.
15
+
16
+ ### Changed
17
+ - 49 binary wheels per extension project (was 28): manylinux and musllinux
18
+ for x86_64 and aarch64, Windows x64, macOS arm64 and x86_64.
19
+
20
+ ## [3.5.0] - 2026-11-12
21
+
22
+ ### Added
23
+ - **Pictures in the terminal** (`flexablelib-components`, see
24
+ `docs/IMAGES.md`): `Image` and `ImageViewer`, and `FilePreview` draws
25
+ image files (and the first page of PDFs and SVGs when `pdftoppm`,
26
+ PyMuPDF, `rsvg-convert` or cairosvg is available). Automatic fallback
27
+ chain: **kitty graphics protocol** (Unicode placeholders on kitty 0.28+,
28
+ Ghostty and through tmux passthrough), **iTerm2 inline images**,
29
+ **sixel**, Unicode blocks (half blocks, quadrants, sextants, braille in
30
+ truecolor / 256 / 16 colours or mono), ASCII, then an **OSC 8 link** that
31
+ opens the picture in the browser (`BROWSER`, `xdg-open`, `gio`, `open`,
32
+ `start`, `wslview`), and with no browser and no display a **warning**
33
+ (`⚠` / `!`) with the file name and the reason -- nothing is opened.
34
+ `fit` (`contain`, `cover`, `fill`, `none`), proportions from the cell
35
+ size in pixels, `alt`, `caption`, `background`, `animate`, `focusable`
36
+ (Enter / `o` / click open it).
37
+ - **Graphics detection** (`flexablelib_tui.graphics`, `detect_graphics`,
38
+ `GraphicsInfo`): environment first (kitty, Ghostty, WezTerm, iTerm2, VS
39
+ Code, Konsole, mintty, Warp, rio, foot, mlterm, contour, Windows
40
+ Terminal, Terminal.app, tmux client features and passthrough, GNU
41
+ screen), then one short query of the terminal (kitty APC query,
42
+ `CSI 16 t` / `CSI 14 t` cell and window pixels, `TIOCGWINSZ`,
43
+ XTSMGRAPHICS, XTVERSION, DA1), cached; `App` asks through its terminal
44
+ and replays keys typed meanwhile. `FLEXABLELIB_IMAGE=kitty|iterm|sixel|
45
+ blocks|half|quadrant|sextant|braille|ascii|link|none` forces a method,
46
+ `FLEXABLELIB_NO_BROWSER=1` says there is no browser.
47
+ - **Image decoding without dependencies** (`flexablelib._images`): PNG
48
+ (every colour type and depth, transparency, Adam7), GIF (frames,
49
+ disposal, interlace), BMP (1–32 bit, bit fields), PPM/PGM/PBM; Pillow
50
+ (`flexablelib[images]`) adds JPEG, WebP, TIFF and the rest. URLs with a
51
+ timeout and a size cap.
52
+ - **C acceleration** in `flexablelib-speedups` for resizing (area
53
+ average), median-cut quantization, the sixel encoder, PNG unfiltering
54
+ and the block/braille conversion, byte-identical to the Python fallback
55
+ (29–87× faster; `tools/bench_images.py`). `FLEXABLELIB_IMAGES=python`
56
+ forces Python.
57
+ - Extras `images` (Pillow) -- included in `all` -- and `svg` (cairosvg).
58
+
59
+ ### Changed
60
+ - Frames carry pictures as an invisible zero-width mark that becomes the
61
+ picture sequence when the frame is written (`str()`, `print`, `Live`,
62
+ `App`): widths, layouts and the frame diff are unchanged. `Live` redraws a
63
+ picture when a line it covers changes and deletes kitty pictures that
64
+ left the screen.
65
+ - `Card` and `Grid` without colour keep the invisible component and picture
66
+ marks (clicks and pictures inside layouts work with `NO_COLOR`).
67
+ - `App` reaches components inside a `Card` body (focus, keys, clicks).
68
+ - The accessibility audit reports `no alt text` for images.
69
+
5
70
  ## [3.4.0] - 2026-11-12
6
71
 
7
72
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flexablelib
3
- Version: 3.4.0
3
+ Version: 3.5.1
4
4
  Summary: Fast, dependency-free terminal tables for Python: 54 border styles, ANSI colors, cell merges, decimal alignment, width fitting, and CSV/Markdown/HTML/Excel/LaTeX I/O.
5
5
  Home-page: https://github.com/Opus-Perpetuus/flexablelib
6
6
  Author: Benjamin Ramirez
@@ -46,18 +46,25 @@ Requires-Dist: openpyxl>=3.0; extra == "excel"
46
46
  Provides-Extra: html
47
47
  Requires-Dist: lxml>=4.0; extra == "html"
48
48
  Provides-Extra: tui
49
- Requires-Dist: flexablelib-tui==3.4.0; extra == "tui"
49
+ Requires-Dist: flexablelib-tui==3.5.1; extra == "tui"
50
50
  Provides-Extra: components
51
- Requires-Dist: flexablelib-components==3.4.0; extra == "components"
51
+ Requires-Dist: flexablelib-components==3.5.1; extra == "components"
52
52
  Provides-Extra: speed
53
- Requires-Dist: flexablelib-speedups==3.4.0; extra == "speed"
53
+ Requires-Dist: flexablelib-speedups==3.5.1; extra == "speed"
54
+ Provides-Extra: images
55
+ Requires-Dist: Pillow>=8; extra == "images"
56
+ Requires-Dist: flexablelib-tui==3.5.1; extra == "images"
57
+ Requires-Dist: flexablelib-components==3.5.1; extra == "images"
58
+ Provides-Extra: svg
59
+ Requires-Dist: cairosvg>=2.5; extra == "svg"
54
60
  Provides-Extra: all
55
61
  Requires-Dist: pandas>=1.0; extra == "all"
56
62
  Requires-Dist: openpyxl>=3.0; extra == "all"
57
63
  Requires-Dist: lxml>=4.0; extra == "all"
58
- Requires-Dist: flexablelib-tui==3.4.0; extra == "all"
59
- Requires-Dist: flexablelib-components==3.4.0; extra == "all"
60
- Requires-Dist: flexablelib-speedups==3.4.0; extra == "all"
64
+ Requires-Dist: Pillow>=8; extra == "all"
65
+ Requires-Dist: flexablelib-tui==3.5.1; extra == "all"
66
+ Requires-Dist: flexablelib-components==3.5.1; extra == "all"
67
+ Requires-Dist: flexablelib-speedups==3.5.1; extra == "all"
61
68
  Dynamic: author
62
69
  Dynamic: author-email
63
70
  Dynamic: classifier
@@ -95,7 +102,7 @@ Dynamic: summary
95
102
 
96
103
  **flexablelib** turns rows and columns into readable tables for terminals, logs,
97
104
  reports and docs. It has **no runtime dependencies**, ships **prebuilt wheels
98
- with an optional C speed-up**, and is covered by **4,400+ tests** on Python
105
+ with an optional C speed-up**, and is covered by **4,500+ tests** on Python
99
106
  3.8 – 3.14 (Linux, Windows, macOS).
100
107
 
101
108
  Since 3.3.0 the same library builds **complete interactive terminal
@@ -208,6 +215,33 @@ Since 3.4.0: [docs/INPUT.md](https://github.com/Opus-Perpetuus/flexablelib/blob/
208
215
  </tr>
209
216
  </table>
210
217
 
218
+ ### Pictures in the terminal
219
+
220
+ Since 3.5.0: [docs/IMAGES.md](https://github.com/Opus-Perpetuus/flexablelib/blob/main/docs/IMAGES.md) — kitty, iTerm2, sixel, Unicode blocks, ASCII, then a link to the browser, then a warning. Real terminals under Xvfb.
221
+
222
+ <table>
223
+ <tr>
224
+ <td width="50%"><b>kitty graphics protocol</b> — detected, Unicode placeholders<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v35/01_kitty.png" alt="A picture in kitty" width="420"></td>
225
+ <td width="50%"><b>iTerm2 inline images</b> — WezTerm, iTerm2, VS Code, Konsole<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v35/02_iterm2_wezterm.png" alt="iTerm2 images in WezTerm" width="420"></td>
226
+ </tr>
227
+ <tr>
228
+ <td><b>sixel</b> — xterm, foot, mlterm, Windows Terminal<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v35/03_sixel_xterm_foot.png" alt="sixel in xterm and foot" width="420"></td>
229
+ <td><b>Unicode blocks</b> — half blocks, quadrants, sextants<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v35/04_bloques_unicode.png" alt="Unicode block pictures" width="420"></td>
230
+ </tr>
231
+ <tr>
232
+ <td><b>Braille and ASCII</b> — mono with NO_COLOR, ASCII without Unicode<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v35/05_braille_ascii.png" alt="Braille and ASCII pictures" width="420"></td>
233
+ <td><b>Inside Grid, Card and App</b> — the frame diff keeps working<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v35/08_card_grid_app.png" alt="Pictures inside a dashboard" width="420"></td>
234
+ </tr>
235
+ <tr>
236
+ <td><b>Link to the browser</b> — OSC 8, Enter or click opens it<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v35/06_enlace_osc8.png" alt="Link fallback" width="420"></td>
237
+ <td><b>No browser, no display</b> — a warning, nothing opened<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v35/07_aviso_sin_navegador.png" alt="Warning when no browser is available" width="420"></td>
238
+ </tr>
239
+ <tr>
240
+ <td><b>Redraws in kitty, xterm and WezTerm</b> — ImageViewer in an App<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v35/09_visor_redibujo.png" alt="ImageViewer switching pictures" width="420"></td>
241
+ <td><b>C acceleration</b> — resize, quantize, sixel, blocks<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v35/10_benchmark.png" alt="C versus Python picture timings" width="420"></td>
242
+ </tr>
243
+ </table>
244
+
211
245
  ### Speed
212
246
 
213
247
  <p align="center">
@@ -21,7 +21,7 @@
21
21
 
22
22
  **flexablelib** turns rows and columns into readable tables for terminals, logs,
23
23
  reports and docs. It has **no runtime dependencies**, ships **prebuilt wheels
24
- with an optional C speed-up**, and is covered by **4,400+ tests** on Python
24
+ with an optional C speed-up**, and is covered by **4,500+ tests** on Python
25
25
  3.8 – 3.14 (Linux, Windows, macOS).
26
26
 
27
27
  Since 3.3.0 the same library builds **complete interactive terminal
@@ -134,6 +134,33 @@ Since 3.4.0: [docs/INPUT.md](https://github.com/Opus-Perpetuus/flexablelib/blob/
134
134
  </tr>
135
135
  </table>
136
136
 
137
+ ### Pictures in the terminal
138
+
139
+ Since 3.5.0: [docs/IMAGES.md](https://github.com/Opus-Perpetuus/flexablelib/blob/main/docs/IMAGES.md) — kitty, iTerm2, sixel, Unicode blocks, ASCII, then a link to the browser, then a warning. Real terminals under Xvfb.
140
+
141
+ <table>
142
+ <tr>
143
+ <td width="50%"><b>kitty graphics protocol</b> — detected, Unicode placeholders<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v35/01_kitty.png" alt="A picture in kitty" width="420"></td>
144
+ <td width="50%"><b>iTerm2 inline images</b> — WezTerm, iTerm2, VS Code, Konsole<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v35/02_iterm2_wezterm.png" alt="iTerm2 images in WezTerm" width="420"></td>
145
+ </tr>
146
+ <tr>
147
+ <td><b>sixel</b> — xterm, foot, mlterm, Windows Terminal<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v35/03_sixel_xterm_foot.png" alt="sixel in xterm and foot" width="420"></td>
148
+ <td><b>Unicode blocks</b> — half blocks, quadrants, sextants<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v35/04_bloques_unicode.png" alt="Unicode block pictures" width="420"></td>
149
+ </tr>
150
+ <tr>
151
+ <td><b>Braille and ASCII</b> — mono with NO_COLOR, ASCII without Unicode<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v35/05_braille_ascii.png" alt="Braille and ASCII pictures" width="420"></td>
152
+ <td><b>Inside Grid, Card and App</b> — the frame diff keeps working<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v35/08_card_grid_app.png" alt="Pictures inside a dashboard" width="420"></td>
153
+ </tr>
154
+ <tr>
155
+ <td><b>Link to the browser</b> — OSC 8, Enter or click opens it<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v35/06_enlace_osc8.png" alt="Link fallback" width="420"></td>
156
+ <td><b>No browser, no display</b> — a warning, nothing opened<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v35/07_aviso_sin_navegador.png" alt="Warning when no browser is available" width="420"></td>
157
+ </tr>
158
+ <tr>
159
+ <td><b>Redraws in kitty, xterm and WezTerm</b> — ImageViewer in an App<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v35/09_visor_redibujo.png" alt="ImageViewer switching pictures" width="420"></td>
160
+ <td><b>C acceleration</b> — resize, quantize, sixel, blocks<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v35/10_benchmark.png" alt="C versus Python picture timings" width="420"></td>
161
+ </tr>
162
+ </table>
163
+
137
164
  ### Speed
138
165
 
139
166
  <p align="center">
@@ -39,7 +39,8 @@ __all__ = ['ACCELERATED', 'BACKEND', 'use', 'available', 'visible_width',
39
39
  'slice_columns',
40
40
  'border_grid', 'changed_lines', 'render_diff', 'ascii_fold',
41
41
  'extract_marks', 'mark_open', 'MARK_CLOSE', 'GLYPH_ORDER',
42
- 'ASCII_FOLD']
42
+ 'ASCII_FOLD', 'GRAPHICS_MARK', 'expand_graphics',
43
+ 'set_graphics_expander']
43
44
 
44
45
  # The order border_grid() expects its 11 glyphs in.
45
46
  GLYPH_ORDER = ('h', 'v', 'tl', 'tr', 'bl', 'br', 'lt', 'rt', 'tt', 'bt', 'x')
@@ -375,3 +376,35 @@ extract_marks = _py_extract_marks
375
376
 
376
377
  use('python' if os.environ.get('FLEXABLELIB_FRAMES', '').lower() == 'python'
377
378
  else 'auto')
379
+
380
+
381
+ # +---------------------------------------------------------------------------+
382
+ # Pictures: frames carry a zero-width mark (ESC ] 8971 ; id BEL) where a
383
+ # picture goes; flexablelib_tui.graphics registers the function that turns
384
+ # marks into kitty / iTerm2 / sixel sequences when a frame is printed.
385
+
386
+ GRAPHICS_MARK = '\x1b]8971;'
387
+ _graphics_expander = None
388
+
389
+
390
+ def set_graphics_expander(function):
391
+ """Install the function :func:`expand_graphics` calls (or ``None``)."""
392
+ global _graphics_expander
393
+ _graphics_expander = function
394
+
395
+
396
+ def expand_graphics(text):
397
+ """``text`` with picture marks expanded, when a picture module is
398
+ loaded and the text has any; otherwise ``text`` unchanged."""
399
+ if GRAPHICS_MARK not in text:
400
+ return text
401
+ function = _graphics_expander
402
+ if function is None:
403
+ # This module may have been reloaded after the picture module
404
+ # registered itself: find it again.
405
+ import sys
406
+ module = sys.modules.get('flexablelib_tui.graphics')
407
+ if module is None:
408
+ return text
409
+ function = module.expand
410
+ return function(text)