flexablelib 3.3.1__tar.gz → 3.5.0__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 (116) hide show
  1. {flexablelib-3.3.1 → flexablelib-3.5.0}/CHANGELOG.md +124 -0
  2. {flexablelib-3.3.1/flexablelib.egg-info → flexablelib-3.5.0}/PKG-INFO +71 -10
  3. flexablelib-3.3.1/PKG-INFO → flexablelib-3.5.0/README.md +57 -77
  4. {flexablelib-3.3.1 → flexablelib-3.5.0}/examples/admin.py +36 -8
  5. flexablelib-3.5.0/examples/keys.py +158 -0
  6. {flexablelib-3.3.1 → flexablelib-3.5.0}/flexablelib/__init__.py +4 -2
  7. {flexablelib-3.3.1 → flexablelib-3.5.0}/flexablelib/_frames.py +199 -2
  8. flexablelib-3.5.0/flexablelib/_images.py +1288 -0
  9. {flexablelib-3.3.1 → flexablelib-3.5.0}/flexablelib/colors.py +13 -3
  10. flexablelib-3.5.0/flexablelib/identifiers.py +91 -0
  11. {flexablelib-3.3.1 → flexablelib-3.5.0}/flexablelib/layout.py +19 -2
  12. {flexablelib-3.3.1 → flexablelib-3.5.0}/flexablelib/table.py +69 -3
  13. {flexablelib-3.3.1 → flexablelib-3.5.0}/flexablelib/writers.py +3 -0
  14. flexablelib-3.3.1/README.md → flexablelib-3.5.0/flexablelib.egg-info/PKG-INFO +138 -3
  15. {flexablelib-3.3.1 → flexablelib-3.5.0}/flexablelib.egg-info/SOURCES.txt +13 -0
  16. flexablelib-3.5.0/flexablelib.egg-info/requires.txt +35 -0
  17. {flexablelib-3.3.1 → flexablelib-3.5.0}/package.json +1 -1
  18. {flexablelib-3.3.1 → flexablelib-3.5.0}/setup.py +6 -1
  19. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v330_components.py +3 -1
  20. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v330_tui.py +3 -3
  21. flexablelib-3.5.0/tests/test_v340_accessibility.py +796 -0
  22. flexablelib-3.5.0/tests/test_v340_core.py +131 -0
  23. flexablelib-3.5.0/tests/test_v340_input.py +802 -0
  24. flexablelib-3.5.0/tests/test_v350_images.py +817 -0
  25. flexablelib-3.5.0/tests/test_v350_images_core.py +672 -0
  26. flexablelib-3.5.0/tests/wincon_child.py +124 -0
  27. flexablelib-3.5.0/tools/bench_images.py +78 -0
  28. flexablelib-3.5.0/tools/gen_ascii_table.py +34 -0
  29. flexablelib-3.5.0/tools/image_demo.py +38 -0
  30. flexablelib-3.5.0/tools/pty_check.py +125 -0
  31. flexablelib-3.3.1/flexablelib.egg-info/requires.txt +0 -26
  32. {flexablelib-3.3.1 → flexablelib-3.5.0}/.coveragerc +0 -0
  33. {flexablelib-3.3.1 → flexablelib-3.5.0}/LICENSE +0 -0
  34. {flexablelib-3.3.1 → flexablelib-3.5.0}/MANIFEST.in +0 -0
  35. {flexablelib-3.3.1 → flexablelib-3.5.0}/examples/dashboard.py +0 -0
  36. {flexablelib-3.3.1 → flexablelib-3.5.0}/flexablelib/_legacy/__init__.py +0 -0
  37. {flexablelib-3.3.1 → flexablelib-3.5.0}/flexablelib/_legacy/screen.py +0 -0
  38. {flexablelib-3.3.1 → flexablelib-3.5.0}/flexablelib/_legacy/widgets.py +0 -0
  39. {flexablelib-3.3.1 → flexablelib-3.5.0}/flexablelib/_speedups.c +0 -0
  40. {flexablelib-3.3.1 → flexablelib-3.5.0}/flexablelib/_width_tables.h +0 -0
  41. {flexablelib-3.3.1 → flexablelib-3.5.0}/flexablelib/box_topology.py +0 -0
  42. {flexablelib-3.3.1 → flexablelib-3.5.0}/flexablelib/cells.py +0 -0
  43. {flexablelib-3.3.1 → flexablelib-3.5.0}/flexablelib/columns.py +0 -0
  44. {flexablelib-3.3.1 → flexablelib-3.5.0}/flexablelib/fast.py +0 -0
  45. {flexablelib-3.3.1 → flexablelib-3.5.0}/flexablelib/merges.py +0 -0
  46. {flexablelib-3.3.1 → flexablelib-3.5.0}/flexablelib/options.py +0 -0
  47. {flexablelib-3.3.1 → flexablelib-3.5.0}/flexablelib/py.typed +0 -0
  48. {flexablelib-3.3.1 → flexablelib-3.5.0}/flexablelib/readers.py +0 -0
  49. {flexablelib-3.3.1 → flexablelib-3.5.0}/flexablelib/screen.py +0 -0
  50. {flexablelib-3.3.1 → flexablelib-3.5.0}/flexablelib/style_compositions.py +0 -0
  51. {flexablelib-3.3.1 → flexablelib-3.5.0}/flexablelib/table_strings.py +0 -0
  52. {flexablelib-3.3.1 → flexablelib-3.5.0}/flexablelib/text_width.py +0 -0
  53. {flexablelib-3.3.1 → flexablelib-3.5.0}/flexablelib/utils.py +0 -0
  54. {flexablelib-3.3.1 → flexablelib-3.5.0}/flexablelib/widgets.py +0 -0
  55. {flexablelib-3.3.1 → flexablelib-3.5.0}/flexablelib.egg-info/dependency_links.txt +0 -0
  56. {flexablelib-3.3.1 → flexablelib-3.5.0}/flexablelib.egg-info/top_level.txt +0 -0
  57. {flexablelib-3.3.1 → flexablelib-3.5.0}/pytest.ini +0 -0
  58. {flexablelib-3.3.1 → flexablelib-3.5.0}/setup.cfg +0 -0
  59. {flexablelib-3.3.1 → flexablelib-3.5.0}/style_examples.md +0 -0
  60. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/conftest.py +0 -0
  61. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/helpers.py +0 -0
  62. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_align_indicators.py +0 -0
  63. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_box_topology.py +0 -0
  64. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_cells.py +0 -0
  65. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_columns.py +0 -0
  66. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_excel.py +0 -0
  67. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_features.py +0 -0
  68. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_issues.py +0 -0
  69. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_merge_edge_matrix.py +0 -0
  70. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_merge_fill.py +0 -0
  71. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_merges.py +0 -0
  72. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_public_api_edges.py +0 -0
  73. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_readme_examples.py +0 -0
  74. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_stress_matrix.py +0 -0
  75. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_style_line_widths.py +0 -0
  76. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_styles.py +0 -0
  77. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_text_width.py +0 -0
  78. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_two_pass_measurement.py +0 -0
  79. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_upstream_issues.py +0 -0
  80. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v2021_fixes.py +0 -0
  81. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v210_rows_copy.py +0 -0
  82. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v2110_fixes.py +0 -0
  83. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v211_fixes.py +0 -0
  84. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v213_features.py +0 -0
  85. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v214_features.py +0 -0
  86. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v215_features.py +0 -0
  87. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v216_features.py +0 -0
  88. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v217_features.py +0 -0
  89. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v218_features.py +0 -0
  90. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v219_coverage.py +0 -0
  91. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v219_fixes.py +0 -0
  92. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v220_exports.py +0 -0
  93. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v221_fixes.py +0 -0
  94. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v222_fixes.py +0 -0
  95. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v223_fixes.py +0 -0
  96. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v224_fixes.py +0 -0
  97. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v230_none.py +0 -0
  98. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v231_fixes.py +0 -0
  99. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v232_merge_ansi.py +0 -0
  100. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v300_style_names.py +0 -0
  101. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v310_layout.py +0 -0
  102. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v320_tui.py +0 -0
  103. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v330_frames.py +0 -0
  104. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v330_layout.py +0 -0
  105. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v331_formats.py +0 -0
  106. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v331_panel_width.py +0 -0
  107. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v331_readers_bom.py +0 -0
  108. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v331_readers_edges.py +0 -0
  109. {flexablelib-3.3.1 → flexablelib-3.5.0}/tests/test_v331_tabs.py +0 -0
  110. {flexablelib-3.3.1 → flexablelib-3.5.0}/tools/bench_frames.py +0 -0
  111. {flexablelib-3.3.1 → flexablelib-3.5.0}/tools/benchmark.py +0 -0
  112. {flexablelib-3.3.1 → flexablelib-3.5.0}/tools/generate_width_tables.py +0 -0
  113. {flexablelib-3.3.1 → flexablelib-3.5.0}/tools/readme_gallery.py +0 -0
  114. {flexablelib-3.3.1 → flexablelib-3.5.0}/tools/stress_matrix.py +0 -0
  115. {flexablelib-3.3.1 → flexablelib-3.5.0}/tools/style_examples.py +0 -0
  116. {flexablelib-3.3.1 → flexablelib-3.5.0}/tools/text_to_png.py +0 -0
@@ -2,6 +2,130 @@
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.0] - 2026-11-12
6
+
7
+ ### Added
8
+ - **Pictures in the terminal** (`flexablelib-components`, see
9
+ `docs/IMAGES.md`): `Image` and `ImageViewer`, and `FilePreview` draws
10
+ image files (and the first page of PDFs and SVGs when `pdftoppm`,
11
+ PyMuPDF, `rsvg-convert` or cairosvg is available). Automatic fallback
12
+ chain: **kitty graphics protocol** (Unicode placeholders on kitty 0.28+,
13
+ Ghostty and through tmux passthrough), **iTerm2 inline images**,
14
+ **sixel**, Unicode blocks (half blocks, quadrants, sextants, braille in
15
+ truecolor / 256 / 16 colours or mono), ASCII, then an **OSC 8 link** that
16
+ opens the picture in the browser (`BROWSER`, `xdg-open`, `gio`, `open`,
17
+ `start`, `wslview`), and with no browser and no display a **warning**
18
+ (`⚠` / `!`) with the file name and the reason -- nothing is opened.
19
+ `fit` (`contain`, `cover`, `fill`, `none`), proportions from the cell
20
+ size in pixels, `alt`, `caption`, `background`, `animate`, `focusable`
21
+ (Enter / `o` / click open it).
22
+ - **Graphics detection** (`flexablelib_tui.graphics`, `detect_graphics`,
23
+ `GraphicsInfo`): environment first (kitty, Ghostty, WezTerm, iTerm2, VS
24
+ Code, Konsole, mintty, Warp, rio, foot, mlterm, contour, Windows
25
+ Terminal, Terminal.app, tmux client features and passthrough, GNU
26
+ screen), then one short query of the terminal (kitty APC query,
27
+ `CSI 16 t` / `CSI 14 t` cell and window pixels, `TIOCGWINSZ`,
28
+ XTSMGRAPHICS, XTVERSION, DA1), cached; `App` asks through its terminal
29
+ and replays keys typed meanwhile. `FLEXABLELIB_IMAGE=kitty|iterm|sixel|
30
+ blocks|half|quadrant|sextant|braille|ascii|link|none` forces a method,
31
+ `FLEXABLELIB_NO_BROWSER=1` says there is no browser.
32
+ - **Image decoding without dependencies** (`flexablelib._images`): PNG
33
+ (every colour type and depth, transparency, Adam7), GIF (frames,
34
+ disposal, interlace), BMP (1–32 bit, bit fields), PPM/PGM/PBM; Pillow
35
+ (`flexablelib[images]`) adds JPEG, WebP, TIFF and the rest. URLs with a
36
+ timeout and a size cap.
37
+ - **C acceleration** in `flexablelib-speedups` for resizing (area
38
+ average), median-cut quantization, the sixel encoder, PNG unfiltering
39
+ and the block/braille conversion, byte-identical to the Python fallback
40
+ (29–87× faster; `tools/bench_images.py`). `FLEXABLELIB_IMAGES=python`
41
+ forces Python.
42
+ - Extras `images` (Pillow) -- included in `all` -- and `svg` (cairosvg).
43
+
44
+ ### Changed
45
+ - Frames carry pictures as an invisible zero-width mark that becomes the
46
+ picture sequence when the frame is written (`str()`, `print`, `Live`,
47
+ `App`): widths, layouts and the frame diff are unchanged. `Live` redraws a
48
+ picture when a line it covers changes and deletes kitty pictures that
49
+ left the screen.
50
+ - `Card` and `Grid` without colour keep the invisible component and picture
51
+ marks (clicks and pictures inside layouts work with `NO_COLOR`).
52
+ - `App` reaches components inside a `Card` body (focus, keys, clicks).
53
+ - The accessibility audit reports `no alt text` for images.
54
+
55
+ ## [3.4.0] - 2026-11-12
56
+
57
+ ### Added
58
+ - **Keyboard input, complete** (`flexablelib-tui`, see `docs/INPUT.md`):
59
+ one key name whatever the terminal sends -- xterm/VT100/VT220 (CSI, SS3,
60
+ 8-bit CSI), rxvt/urxvt, the Linux console, Alt as an ESC prefix, F1–F24
61
+ (F35 with kitty) with any modifier, Ctrl/Alt/Shift/Meta/Super/Hyper in a
62
+ fixed order (`ctrl+alt+shift+f12`), the **kitty keyboard protocol**
63
+ (Ctrl+I vs Tab, Ctrl+Enter, keypad, press/repeat/release), xterm
64
+ **modifyOtherKeys**, bracketed paste (even split across reads), terminal
65
+ focus in/out and terminal answers (DA, DECRQM, XTVERSION, kitty flags).
66
+ `Key` carries `char`, `event`, `mouse`, `data` and `raw`;
67
+ `normalize_key`, `key_label`.
68
+ - **Windows Console API input** (`wincon`): `ReadConsoleInputW` records
69
+ with virtual-key codes and modifiers (AltGr, F13–F24, surrogate pairs,
70
+ mouse, wheel, resize, focus), virtual-terminal input and the `msvcrt`
71
+ fallback (`Terminal(windows='records' | 'vt' | 'msvcrt')`). CI injects
72
+ records into a real console on `windows-latest`.
73
+ - **Capability detection** (`detect_capabilities`, `capabilities.probe`):
74
+ colour level, Unicode, size and terminal from the environment, then a
75
+ probe of the terminal itself; `Terminal(keyboard='auto')` turns on the
76
+ kitty protocol or modifyOtherKeys when available and restores everything
77
+ on exit.
78
+ - **Key map** (`KeyMap`): remap keys, name actions (`focus_next`, `quit`,
79
+ `help`, `read_screen` ...), `describe`, `conflicts`, save/load JSON;
80
+ `App(keymap=...)`.
81
+ - **Mouse in every component**: `App(mouse=True)` (or `'hover'`) knows
82
+ which component drew each cell and focuses and passes clicks to it --
83
+ buttons, checkboxes, switches, radios, tabs, menus, sidebar, pagination,
84
+ sort controls, calendars and date pickers, selects, autocomplete, file
85
+ entries, trees, accordions, carousels, links, alerts, `DataTable` rows,
86
+ checkbox column and headers, catalog cards. The wheel scrolls what is
87
+ under the pointer; drags move `Split` dividers and scroll bars, with
88
+ capture until release. `Component.on_mouse(event)` in local coordinates;
89
+ `_Themed.hot()` registers clickable spots.
90
+ - **Accessibility** (`flexablelib_tui.accessibility`, see
91
+ `docs/ACCESSIBILITY.md`): settings from the environment
92
+ (`FLEXABLELIB_SCREEN_READER`, `_REDUCED_MOTION`, `_ASCII`,
93
+ `_FOCUS_MARKER`, `_THEME`, `_LANG`, `_A11Y`) or `App(...)` arguments;
94
+ **screen-reader mode** (linear text with role, label, value, state and
95
+ description; announcements of focus, changes, dialogs and notifications
96
+ to stdout, stderr, a file or a callback; Ctrl+R reads the screen);
97
+ roles, accessible names, values and states for every component;
98
+ focus visible without colour (text markers); **themes** `high-contrast`,
99
+ `high-contrast-light`, `deuteranopia`, `protanopia`, `tritanopia`,
100
+ `monochrome` with WCAG contrast (`Theme.contrast()`, `contrast_ratio`)
101
+ and colour-blindness simulation (`simulate_cvd`, `delta_e`);
102
+ `App(theme=...)`; static spinners and skeletons with reduced motion;
103
+ status with symbol and word (`status_symbol`), chart markers per series;
104
+ ASCII fallback for frames; `App(min_size=...)`; F1 help screen built from
105
+ the bindings; `tab_index`; `audit()` checks role, label and visible focus.
106
+ - **Folios** (see `docs/FOLIOS.md`): `Table.id_columns` (`'auto'`, a list,
107
+ or `None` as before) and `Table.id_names` print identifiers -- folios,
108
+ IDs, codes, SKUs, postal codes, years -- without thousands separators
109
+ while quantities and money keep them; `flexablelib.is_id_column` and
110
+ `ID_COLUMN_NAMES`; `to_excel` follows. `DataTable` column `type`
111
+ `'id'` / `'number'` / `'money'`, `id_columns`, `id_names`.
112
+ - C: `ascii_fold` (8× faster) and `extract_marks` (click zones, 2× faster)
113
+ in `flexablelib-speedups`, with Python fallbacks and parity tests.
114
+ - `examples/keys.py`: live key and mouse detector. `examples/admin.py`
115
+ takes `--theme`, `--screen-reader`, `--ascii`, `--reduced-motion`,
116
+ `--focus-marker` and `click:X:Y` keys.
117
+
118
+ ### Changed
119
+ - `DataTable` no longer puts thousands separators in identifier columns
120
+ by name (`id_columns=False` restores 3.3).
121
+ - The default selection style is bold as well as coloured; without colour,
122
+ focus and selection use text markers (`[>Guardar<]`, `>` before the
123
+ current item).
124
+ - On `TERM=dumb` the app prints linear text and switches no terminal
125
+ modes (no paste, focus or mouse escape sequences).
126
+ - `FORCE_COLOR=0` turns colour off. Colour specs accept attributes after
127
+ the background (`black on cyan underline`).
128
+
5
129
  ## [3.3.1] - 2026-11-12
6
130
 
7
131
  ### Fixed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flexablelib
3
- Version: 3.3.1
3
+ Version: 3.5.0
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.3.1; extra == "tui"
49
+ Requires-Dist: flexablelib-tui==3.5.0; extra == "tui"
50
50
  Provides-Extra: components
51
- Requires-Dist: flexablelib-components==3.3.1; extra == "components"
51
+ Requires-Dist: flexablelib-components==3.5.0; extra == "components"
52
52
  Provides-Extra: speed
53
- Requires-Dist: flexablelib-speedups==3.3.1; extra == "speed"
53
+ Requires-Dist: flexablelib-speedups==3.5.0; extra == "speed"
54
+ Provides-Extra: images
55
+ Requires-Dist: Pillow>=8; extra == "images"
56
+ Requires-Dist: flexablelib-tui==3.5.0; extra == "images"
57
+ Requires-Dist: flexablelib-components==3.5.0; 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.3.1; extra == "all"
59
- Requires-Dist: flexablelib-components==3.3.1; extra == "all"
60
- Requires-Dist: flexablelib-speedups==3.3.1; extra == "all"
64
+ Requires-Dist: Pillow>=8; extra == "all"
65
+ Requires-Dist: flexablelib-tui==3.5.0; extra == "all"
66
+ Requires-Dist: flexablelib-components==3.5.0; extra == "all"
67
+ Requires-Dist: flexablelib-speedups==3.5.0; 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 **3,900+ 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
@@ -181,6 +188,60 @@ in colour or plain text: the full list, what each does and its keys is in
181
188
  </tr>
182
189
  </table>
183
190
 
191
+ ### Keyboard, mouse and accessibility
192
+
193
+ Since 3.4.0: [docs/INPUT.md](https://github.com/Opus-Perpetuus/flexablelib/blob/main/docs/INPUT.md) · [docs/ACCESSIBILITY.md](https://github.com/Opus-Perpetuus/flexablelib/blob/main/docs/ACCESSIBILITY.md) · [docs/FOLIOS.md](https://github.com/Opus-Perpetuus/flexablelib/blob/main/docs/FOLIOS.md).
194
+
195
+ <table>
196
+ <tr>
197
+ <td width="50%"><b>Every key detected</b> — F1–F24, Ctrl/Alt/Shift/Super, paste, focus, mouse — <code>examples/keys.py</code><br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v34/01_detector_teclas.png" alt="Live key detector" width="420"></td>
198
+ <td width="50%"><b>Mouse in every component</b> — click, wheel, drag<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v34/02_raton.png" alt="Clicks on buttons, tabs, tables and calendars" width="420"></td>
199
+ </tr>
200
+ <tr>
201
+ <td><b>Focus visible without colour</b> — text markers, not colour alone<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v34/03_foco_visible.png" alt="Focus with and without colour" width="420"></td>
202
+ <td><b>High contrast</b> — WCAG AAA text, checked by the tests<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v34/04_alto_contraste.png" alt="High-contrast theme with contrast ratios" width="420"></td>
203
+ </tr>
204
+ <tr>
205
+ <td><b>Colour-blind themes</b> — deuteranopia, protanopia, tritanopia — simulated<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v34/05_daltonismo.png" alt="Status colours under colour-blindness simulation" width="420"></td>
206
+ <td><b>Screen readers</b> — linear text, roles, labels, announcements<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v34/06_lector_pantalla.png" alt="Screen-reader linear output" width="420"></td>
207
+ </tr>
208
+ <tr>
209
+ <td><b>ASCII and reduced motion</b> — no Unicode, still spinners<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v34/07_ascii.png" alt="The app in ASCII mode" width="420"></td>
210
+ <td><b>Folios</b> — IDs without thousands separators, money with them<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v34/08_folios.png" alt="Folio columns versus money columns" width="420"></td>
211
+ </tr>
212
+ <tr>
213
+ <td><b>One name per key</b> — xterm, rxvt, Linux console, kitty, modifyOtherKeys, Windows<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v34/10_protocolos.png" alt="Key names across protocols" width="420"></td>
214
+ <td><b>C acceleration</b> — ASCII fallback and click zones<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v34/09_benchmark.png" alt="C versus Python timings" width="420"></td>
215
+ </tr>
216
+ </table>
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
+
184
245
  ### Speed
185
246
 
186
247
  <p align="center">
@@ -470,10 +531,10 @@ Open work and the issue map: [docs/ISSUES.md](https://github.com/Opus-Perpetuus/
470
531
  ## Project layout
471
532
 
472
533
  - `flexablelib/` — the core package (no runtime dependencies): `table.py` (the Table class), `layout.py` (Card, Grid, GridCell), `_frames.py` (frame primitives, C or Python), `columns.py`, `cells.py`, `table_strings.py`, `style_compositions.py` (the 54 styles, as data), `text_width.py` / `fast.py` (terminal-width measurement, C or Python), readers and writers.
473
- - `packages/tui/` — `flexablelib-tui`: widgets, Screen, Live, App, keyboard input.
534
+ - `packages/tui/` — `flexablelib-tui`: widgets, Screen, Live, App, keyboard and mouse input, accessibility.
474
535
  - `packages/components/` — `flexablelib-components`: the terminal components.
475
536
  - `packages/speedups/` — `flexablelib-speedups`: the C frame code.
476
- - `examples/` — `dashboard.py`, `admin.py`.
537
+ - `examples/` — `dashboard.py`, `admin.py`, `keys.py` (live key detector).
477
538
  - `tests/` — the pytest suite; `tools/` — benchmarks and generators; `docs/` — guides and images.
478
539
  - `ARCHITECTURE.md` — how it all fits together; `style_examples.md` — all 54 styles; `package.json` — the canonical version number.
479
540
 
@@ -1,77 +1,3 @@
1
- Metadata-Version: 2.4
2
- Name: flexablelib
3
- Version: 3.3.1
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
- Home-page: https://github.com/Opus-Perpetuus/flexablelib
6
- Author: Benjamin Ramirez
7
- Author-email: chilerito12@gmail.com
8
- License: MIT
9
- Project-URL: Documentation, https://github.com/Opus-Perpetuus/flexablelib#readme
10
- Project-URL: Source, https://github.com/Opus-Perpetuus/flexablelib
11
- Project-URL: Issues, https://github.com/Opus-Perpetuus/flexablelib/issues
12
- Project-URL: Changelog, https://github.com/Opus-Perpetuus/flexablelib/blob/main/CHANGELOG.md
13
- Project-URL: Releases, https://github.com/Opus-Perpetuus/flexablelib/releases
14
- Keywords: table,tables,terminal,console,cli,ascii-table,pretty-print,prettytable,tabulate,tabular-data,ansi,ansi-colors,unicode,box-drawing,markdown,html,csv,excel,latex,formatting
15
- Classifier: Development Status :: 5 - Production/Stable
16
- Classifier: Environment :: Console
17
- Classifier: Intended Audience :: Developers
18
- Classifier: Intended Audience :: System Administrators
19
- Classifier: Intended Audience :: Science/Research
20
- Classifier: License :: OSI Approved :: MIT License
21
- Classifier: Operating System :: OS Independent
22
- Classifier: Programming Language :: C
23
- Classifier: Topic :: Terminals
24
- Classifier: Topic :: Text Processing
25
- Classifier: Topic :: Text Processing :: Markup
26
- Classifier: Topic :: Software Development :: Libraries
27
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
28
- Classifier: Topic :: Utilities
29
- Classifier: Typing :: Typed
30
- Classifier: Programming Language :: Python :: 3
31
- Classifier: Programming Language :: Python :: 3.8
32
- Classifier: Programming Language :: Python :: 3.9
33
- Classifier: Programming Language :: Python :: 3.10
34
- Classifier: Programming Language :: Python :: 3.11
35
- Classifier: Programming Language :: Python :: 3.12
36
- Classifier: Programming Language :: Python :: 3.13
37
- Classifier: Programming Language :: Python :: 3.14
38
- Classifier: Programming Language :: Python :: 3 :: Only
39
- Requires-Python: >=3.8
40
- Description-Content-Type: text/markdown
41
- License-File: LICENSE
42
- Provides-Extra: pandas
43
- Requires-Dist: pandas>=1.0; extra == "pandas"
44
- Provides-Extra: excel
45
- Requires-Dist: openpyxl>=3.0; extra == "excel"
46
- Provides-Extra: html
47
- Requires-Dist: lxml>=4.0; extra == "html"
48
- Provides-Extra: tui
49
- Requires-Dist: flexablelib-tui==3.3.1; extra == "tui"
50
- Provides-Extra: components
51
- Requires-Dist: flexablelib-components==3.3.1; extra == "components"
52
- Provides-Extra: speed
53
- Requires-Dist: flexablelib-speedups==3.3.1; extra == "speed"
54
- Provides-Extra: all
55
- Requires-Dist: pandas>=1.0; extra == "all"
56
- Requires-Dist: openpyxl>=3.0; extra == "all"
57
- Requires-Dist: lxml>=4.0; extra == "all"
58
- Requires-Dist: flexablelib-tui==3.3.1; extra == "all"
59
- Requires-Dist: flexablelib-components==3.3.1; extra == "all"
60
- Requires-Dist: flexablelib-speedups==3.3.1; extra == "all"
61
- Dynamic: author
62
- Dynamic: author-email
63
- Dynamic: classifier
64
- Dynamic: description
65
- Dynamic: description-content-type
66
- Dynamic: home-page
67
- Dynamic: keywords
68
- Dynamic: license
69
- Dynamic: license-file
70
- Dynamic: project-url
71
- Dynamic: provides-extra
72
- Dynamic: requires-python
73
- Dynamic: summary
74
-
75
1
  <p align="center">
76
2
  <img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/logos/export/logo-1024.png" alt="flexablelib" width="440">
77
3
  </p>
@@ -95,7 +21,7 @@ Dynamic: summary
95
21
 
96
22
  **flexablelib** turns rows and columns into readable tables for terminals, logs,
97
23
  reports and docs. It has **no runtime dependencies**, ships **prebuilt wheels
98
- with an optional C speed-up**, and is covered by **3,900+ tests** on Python
24
+ with an optional C speed-up**, and is covered by **4,500+ tests** on Python
99
25
  3.8 – 3.14 (Linux, Windows, macOS).
100
26
 
101
27
  Since 3.3.0 the same library builds **complete interactive terminal
@@ -181,6 +107,60 @@ in colour or plain text: the full list, what each does and its keys is in
181
107
  </tr>
182
108
  </table>
183
109
 
110
+ ### Keyboard, mouse and accessibility
111
+
112
+ Since 3.4.0: [docs/INPUT.md](https://github.com/Opus-Perpetuus/flexablelib/blob/main/docs/INPUT.md) · [docs/ACCESSIBILITY.md](https://github.com/Opus-Perpetuus/flexablelib/blob/main/docs/ACCESSIBILITY.md) · [docs/FOLIOS.md](https://github.com/Opus-Perpetuus/flexablelib/blob/main/docs/FOLIOS.md).
113
+
114
+ <table>
115
+ <tr>
116
+ <td width="50%"><b>Every key detected</b> — F1–F24, Ctrl/Alt/Shift/Super, paste, focus, mouse — <code>examples/keys.py</code><br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v34/01_detector_teclas.png" alt="Live key detector" width="420"></td>
117
+ <td width="50%"><b>Mouse in every component</b> — click, wheel, drag<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v34/02_raton.png" alt="Clicks on buttons, tabs, tables and calendars" width="420"></td>
118
+ </tr>
119
+ <tr>
120
+ <td><b>Focus visible without colour</b> — text markers, not colour alone<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v34/03_foco_visible.png" alt="Focus with and without colour" width="420"></td>
121
+ <td><b>High contrast</b> — WCAG AAA text, checked by the tests<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v34/04_alto_contraste.png" alt="High-contrast theme with contrast ratios" width="420"></td>
122
+ </tr>
123
+ <tr>
124
+ <td><b>Colour-blind themes</b> — deuteranopia, protanopia, tritanopia — simulated<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v34/05_daltonismo.png" alt="Status colours under colour-blindness simulation" width="420"></td>
125
+ <td><b>Screen readers</b> — linear text, roles, labels, announcements<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v34/06_lector_pantalla.png" alt="Screen-reader linear output" width="420"></td>
126
+ </tr>
127
+ <tr>
128
+ <td><b>ASCII and reduced motion</b> — no Unicode, still spinners<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v34/07_ascii.png" alt="The app in ASCII mode" width="420"></td>
129
+ <td><b>Folios</b> — IDs without thousands separators, money with them<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v34/08_folios.png" alt="Folio columns versus money columns" width="420"></td>
130
+ </tr>
131
+ <tr>
132
+ <td><b>One name per key</b> — xterm, rxvt, Linux console, kitty, modifyOtherKeys, Windows<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v34/10_protocolos.png" alt="Key names across protocols" width="420"></td>
133
+ <td><b>C acceleration</b> — ASCII fallback and click zones<br><img src="https://raw.githubusercontent.com/Opus-Perpetuus/flexablelib/main/docs/img/v34/09_benchmark.png" alt="C versus Python timings" width="420"></td>
134
+ </tr>
135
+ </table>
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
+
184
164
  ### Speed
185
165
 
186
166
  <p align="center">
@@ -470,10 +450,10 @@ Open work and the issue map: [docs/ISSUES.md](https://github.com/Opus-Perpetuus/
470
450
  ## Project layout
471
451
 
472
452
  - `flexablelib/` — the core package (no runtime dependencies): `table.py` (the Table class), `layout.py` (Card, Grid, GridCell), `_frames.py` (frame primitives, C or Python), `columns.py`, `cells.py`, `table_strings.py`, `style_compositions.py` (the 54 styles, as data), `text_width.py` / `fast.py` (terminal-width measurement, C or Python), readers and writers.
473
- - `packages/tui/` — `flexablelib-tui`: widgets, Screen, Live, App, keyboard input.
453
+ - `packages/tui/` — `flexablelib-tui`: widgets, Screen, Live, App, keyboard and mouse input, accessibility.
474
454
  - `packages/components/` — `flexablelib-components`: the terminal components.
475
455
  - `packages/speedups/` — `flexablelib-speedups`: the C frame code.
476
- - `examples/` — `dashboard.py`, `admin.py`.
456
+ - `examples/` — `dashboard.py`, `admin.py`, `keys.py` (live key detector).
477
457
  - `tests/` — the pytest suite; `tools/` — benchmarks and generators; `docs/` — guides and images.
478
458
  - `ARCHITECTURE.md` — how it all fits together; `style_examples.md` — all 54 styles; `package.json` — the canonical version number.
479
459
 
@@ -7,11 +7,16 @@ terminal packages (``pip install flexablelib[tui,components,speed]``).
7
7
  python examples/admin.py --frame 120x36 # print one frame and exit
8
8
  python examples/admin.py --frame 120x36 --keys "tab,down,down,enter"
9
9
  python examples/admin.py --frame 80x24 --no-color
10
+ python examples/admin.py --theme high-contrast --screen-reader
11
+ python examples/admin.py --frame 100x30 --keys "click:3:5" --ascii
10
12
 
11
13
  Keys: Tab / Shift-Tab move the focus, Ctrl-B shows or hides the sidebar,
12
14
  Ctrl-K opens the command palette, Ctrl-N a new-customer form, F1 the help,
13
- Ctrl-Q quits. In the orders table: arrows, 1-9 sort, / filter, Space
14
- selects, Enter opens the order.
15
+ Ctrl-Q quits, Ctrl-R reads the screen aloud (screen-reader mode). In the
16
+ orders table: arrows, 1-9 sort, / filter, Space selects, Enter opens the
17
+ order. The mouse works too: click to focus and press, wheel to scroll,
18
+ drag the scroll bars; ``--theme`` picks a theme (high-contrast,
19
+ deuteranopia, protanopia, tritanopia, monochrome ...).
15
20
 
16
21
  Pieces: AppShell (sidebar, top bar, pages), Stat cards, LineChart,
17
22
  DataTable bound to a FilterBar, Form with validation, Calendar, Timeline,
@@ -36,7 +41,7 @@ for path in (ROOT, os.path.join(ROOT, 'packages', 'tui'),
36
41
  import flexablelib_components as C # noqa: E402
37
42
  from flexablelib import KeyHints # noqa: E402
38
43
  from flexablelib import _frames # noqa: E402
39
- from flexablelib_tui import App, Component # noqa: E402
44
+ from flexablelib_tui import App, Component, parse_keys # noqa: E402
40
45
 
41
46
  TODAY = dt.date(2026, 11, 11)
42
47
 
@@ -70,7 +75,7 @@ STATES = {'pagado': 'green', 'pendiente': 'yellow', 'enviado': 'cyan',
70
75
  class Admin(object):
71
76
  """Builds the screens and wires the actions."""
72
77
 
73
- def __init__(self):
78
+ def __init__(self, **app_options):
74
79
  self.orders = C.DataTable(
75
80
  [{'key': 'folio', 'title': 'Folio', 'align': 'r', 'format': str},
76
81
  {'key': 'cliente', 'title': 'Cliente'},
@@ -92,13 +97,15 @@ class Admin(object):
92
97
  self.shell = C.AppShell(sidebar=self.sidebar, topbar=self.topbar,
93
98
  pages=self.pages())
94
99
  self.app = App(
100
+ mouse=True, title='Tienda · administración', **app_options,
95
101
  body=self.shell,
96
102
  footer=KeyHints([('Tab', 'Foco'), ('Ctrl-B', 'Menú'),
97
103
  ('Ctrl-K', 'Comandos'), ('Ctrl-N', 'Nuevo'),
98
104
  ('F1', 'Ayuda'), ('Ctrl-Q', 'Salir')]),
99
- bindings={'ctrl+q': lambda: self.app.exit(),
100
- 'ctrl+k': self.palette, 'ctrl+n': self.new_customer,
101
- 'f1': self.help})
105
+ bindings={'ctrl+q': (lambda: self.app.exit(), 'Salir'),
106
+ 'ctrl+k': (self.palette, 'Paleta de comandos'),
107
+ 'ctrl+n': (self.new_customer, 'Nuevo cliente'),
108
+ 'f1': (self.help, 'Ayuda')})
102
109
 
103
110
  # -- pages --------------------------------------------------------------
104
111
 
@@ -234,10 +241,24 @@ def main(argv=None):
234
241
  parser.add_argument('--keys', default='',
235
242
  help='comma-separated keys fed before the frame')
236
243
  parser.add_argument('--no-color', action='store_true')
244
+ parser.add_argument('--theme', help='high-contrast, deuteranopia, '
245
+ 'protanopia, tritanopia, monochrome ...')
246
+ parser.add_argument('--screen-reader', action='store_true',
247
+ help='linear text with roles; announcements')
248
+ parser.add_argument('--announce', metavar='TARGET',
249
+ help='stdout, stderr or a file for announcements')
250
+ parser.add_argument('--ascii', action='store_true')
251
+ parser.add_argument('--focus-marker', action='store_true')
252
+ parser.add_argument('--reduced-motion', action='store_true')
237
253
  args = parser.parse_args(argv)
238
254
  if args.no_color:
239
255
  Component.use_colors = False
240
- admin = Admin()
256
+ options = dict((k, v) for k, v in (('theme', args.theme),
257
+ ('announce', args.announce)) if v)
258
+ for name in ('screen_reader', 'ascii', 'focus_marker', 'reduced_motion'):
259
+ if getattr(args, name):
260
+ options[name] = True
261
+ admin = Admin(**options)
241
262
  if not args.frame:
242
263
  admin.app.run()
243
264
  return 0
@@ -248,6 +269,13 @@ def main(argv=None):
248
269
  keys = [k.strip() for k in args.keys.split(',') if k.strip()]
249
270
  for key in keys:
250
271
  admin.app.render(width, height)
272
+ if key.startswith('click:'):
273
+ # click:X:Y -- a mouse click at that cell (0-based).
274
+ x, y = (int(n) + 1 for n in key.split(':')[1:3])
275
+ for seq in ('\x1b[<0;{0};{1}M', '\x1b[<0;{0};{1}m'):
276
+ for parsed in parse_keys(seq.format(x, y)):
277
+ admin.app.dispatch(parsed)
278
+ continue
251
279
  admin.app.dispatch(key)
252
280
  sys.stdout.write(admin.app.render(width, height) + '\n')
253
281
  sys.stderr.write('frames backend: {0}\n'.format(_frames.BACKEND))