flexablelib 2.0.0__tar.gz → 2.0.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 (41) hide show
  1. {flexablelib-2.0.0 → flexablelib-2.0.1}/CHANGELOG.md +68 -61
  2. {flexablelib-2.0.0/flexablelib.egg-info → flexablelib-2.0.1}/PKG-INFO +11 -24
  3. {flexablelib-2.0.0 → flexablelib-2.0.1}/README.md +8 -21
  4. {flexablelib-2.0.0 → flexablelib-2.0.1}/flexablelib/cells.py +3 -2
  5. {flexablelib-2.0.0 → flexablelib-2.0.1}/flexablelib/columns.py +17 -0
  6. {flexablelib-2.0.0 → flexablelib-2.0.1}/flexablelib/table.py +14 -2
  7. {flexablelib-2.0.0 → flexablelib-2.0.1/flexablelib.egg-info}/PKG-INFO +11 -24
  8. {flexablelib-2.0.0 → flexablelib-2.0.1}/package.json +5 -5
  9. {flexablelib-2.0.0 → flexablelib-2.0.1}/setup.py +2 -2
  10. {flexablelib-2.0.0 → flexablelib-2.0.1}/tests/test_features.py +40 -0
  11. {flexablelib-2.0.0 → flexablelib-2.0.1}/LICENSE +0 -0
  12. {flexablelib-2.0.0 → flexablelib-2.0.1}/MANIFEST.in +0 -0
  13. {flexablelib-2.0.0 → flexablelib-2.0.1}/flexablelib/__init__.py +0 -0
  14. {flexablelib-2.0.0 → flexablelib-2.0.1}/flexablelib/_speedups.c +0 -0
  15. {flexablelib-2.0.0 → flexablelib-2.0.1}/flexablelib/_width_tables.h +0 -0
  16. {flexablelib-2.0.0 → flexablelib-2.0.1}/flexablelib/colors.py +0 -0
  17. {flexablelib-2.0.0 → flexablelib-2.0.1}/flexablelib/fast.py +0 -0
  18. {flexablelib-2.0.0 → flexablelib-2.0.1}/flexablelib/merges.py +0 -0
  19. {flexablelib-2.0.0 → flexablelib-2.0.1}/flexablelib/options.py +0 -0
  20. {flexablelib-2.0.0 → flexablelib-2.0.1}/flexablelib/readers.py +0 -0
  21. {flexablelib-2.0.0 → flexablelib-2.0.1}/flexablelib/style_compositions.py +0 -0
  22. {flexablelib-2.0.0 → flexablelib-2.0.1}/flexablelib/table_strings.py +0 -0
  23. {flexablelib-2.0.0 → flexablelib-2.0.1}/flexablelib/text_width.py +0 -0
  24. {flexablelib-2.0.0 → flexablelib-2.0.1}/flexablelib/utils.py +0 -0
  25. {flexablelib-2.0.0 → flexablelib-2.0.1}/flexablelib/writers.py +0 -0
  26. {flexablelib-2.0.0 → flexablelib-2.0.1}/flexablelib.egg-info/SOURCES.txt +0 -0
  27. {flexablelib-2.0.0 → flexablelib-2.0.1}/flexablelib.egg-info/dependency_links.txt +0 -0
  28. {flexablelib-2.0.0 → flexablelib-2.0.1}/flexablelib.egg-info/requires.txt +0 -0
  29. {flexablelib-2.0.0 → flexablelib-2.0.1}/flexablelib.egg-info/top_level.txt +0 -0
  30. {flexablelib-2.0.0 → flexablelib-2.0.1}/setup.cfg +0 -0
  31. {flexablelib-2.0.0 → flexablelib-2.0.1}/tests/test_cells.py +0 -0
  32. {flexablelib-2.0.0 → flexablelib-2.0.1}/tests/test_columns.py +0 -0
  33. {flexablelib-2.0.0 → flexablelib-2.0.1}/tests/test_issues.py +0 -0
  34. {flexablelib-2.0.0 → flexablelib-2.0.1}/tests/test_merges.py +0 -0
  35. {flexablelib-2.0.0 → flexablelib-2.0.1}/tests/test_readme_examples.py +0 -0
  36. {flexablelib-2.0.0 → flexablelib-2.0.1}/tests/test_styles.py +0 -0
  37. {flexablelib-2.0.0 → flexablelib-2.0.1}/tests/test_text_width.py +0 -0
  38. {flexablelib-2.0.0 → flexablelib-2.0.1}/tests/test_two_pass_measurement.py +0 -0
  39. {flexablelib-2.0.0 → flexablelib-2.0.1}/tests/test_upstream_issues.py +0 -0
  40. {flexablelib-2.0.0 → flexablelib-2.0.1}/tools/benchmark.py +0 -0
  41. {flexablelib-2.0.0 → flexablelib-2.0.1}/tools/generate_width_tables.py +0 -0
@@ -2,7 +2,14 @@
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
- ## [2.0.0](https://github.com/Opus-Perpetuus/prettyTables/compare/v1.4.1...v2.0.0) (2026-10-28)
5
+ ## [2.0.1](https://github.com/Opus-Perpetuus/flexablelib/compare/v2.0.0...v2.0.1) (2026-10-28)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * `missing_val` is now an alias of `missing_value` (docs and constructor kwarg name no longer silently no-op)
11
+
12
+ ## [2.0.0](https://github.com/Opus-Perpetuus/flexablelib/compare/v1.4.1...v2.0.0) (2026-10-28)
6
13
 
7
14
 
8
15
  ### ⚠ BREAKING CHANGES
@@ -19,7 +26,7 @@ All notable changes to this project will be documented in this file. See [standa
19
26
 
20
27
  * colour merge tests pin `use_colors=True` so CI without a TTY still asserts ANSI codes
21
28
 
22
- ## [1.4.1](https://github.com/Opus-Perpetuus/prettyTables/compare/v1.4.0...v1.4.1) (2026-08-03)
29
+ ## [1.4.1](https://github.com/Opus-Perpetuus/flexablelib/compare/v1.4.0...v1.4.1) (2026-08-03)
23
30
 
24
31
 
25
32
  ### Bug Fixes
@@ -27,7 +34,7 @@ All notable changes to this project will be documented in this file. See [standa
27
34
  * `column_max_width` now wraps or trims cell content to the cap (was only
28
35
  changing the measured width number, so long cells still overflowed)
29
36
 
30
- ## [1.4.0](https://github.com/Opus-Perpetuus/prettyTables/compare/v1.3.0...v1.4.0) (2026-08-03)
37
+ ## [1.4.0](https://github.com/Opus-Perpetuus/flexablelib/compare/v1.3.0...v1.4.0) (2026-08-03)
31
38
 
32
39
 
33
40
  ### Features
@@ -45,9 +52,9 @@ All notable changes to this project will be documented in this file. See [standa
45
52
 
46
53
  ### Bug Fixes
47
54
 
48
- * float columns keep decimal alignment when the table is shrunk ([#23](https://github.com/Opus-Perpetuus/prettyTables/issues/23))
49
- * alignment options are actually applied; `bool_align` no longer wrote the float slot ([#4](https://github.com/Opus-Perpetuus/prettyTables/issues/4))
50
- * empty rows and columns share one emptiness criterion ([#9](https://github.com/Opus-Perpetuus/prettyTables/issues/9))
55
+ * float columns keep decimal alignment when the table is shrunk ([#23](https://github.com/Opus-Perpetuus/flexablelib/issues/23))
56
+ * alignment options are actually applied; `bool_align` no longer wrote the float slot ([#4](https://github.com/Opus-Perpetuus/flexablelib/issues/4))
57
+ * empty rows and columns share one emptiness criterion ([#9](https://github.com/Opus-Perpetuus/flexablelib/issues/9))
51
58
  * column named `"i"` no longer collides with the index column
52
59
  * exponential numbers align with the float column
53
60
  * tabs, emoji VS16, empty header-only tables, markdown alignment colons, and other upstream regressions
@@ -60,117 +67,117 @@ All notable changes to this project will be documented in this file. See [standa
60
67
  * `docs/ISSUES.md` maps every tracker issue to its fix and tests
61
68
  * README Known Issues and ARCHITECTURE Known gaps brought in line with current behaviour
62
69
 
63
- ## [1.3.0](https://github.com/Opus-Perpetuus/prettyTables/compare/v1.2.0...v1.3.0) (2026-08-03)
70
+ ## [1.3.0](https://github.com/Opus-Perpetuus/flexablelib/compare/v1.2.0...v1.3.0) (2026-08-03)
64
71
 
65
72
 
66
73
  ### Features
67
74
 
68
- * merge cells across columns, down rows, or both, via `merge_cells()` ([39f6e56](https://github.com/Opus-Perpetuus/prettyTables/commit/39f6e56))
75
+ * merge cells across columns, down rows, or both, via `merge_cells()` ([39f6e56](https://github.com/Opus-Perpetuus/flexablelib/commit/39f6e56))
69
76
 
70
77
 
71
78
  ### Performance Improvements
72
79
 
73
- * skip the redundant second measuring pass when the table already fits, and cut per-cell helper overhead; 2000x4 renders in 16.9ms against 30.6ms, making this the fastest of flexablelib, prettytable, tabulate and pandas .to_string() on the same data ([88b01f0](https://github.com/Opus-Perpetuus/prettyTables/commit/88b01f0))
80
+ * skip the redundant second measuring pass when the table already fits, and cut per-cell helper overhead; 2000x4 renders in 16.9ms against 30.6ms, making this the fastest of flexablelib, prettytable, tabulate and pandas .to_string() on the same data ([88b01f0](https://github.com/Opus-Perpetuus/flexablelib/commit/88b01f0))
74
81
 
75
82
 
76
83
  ### Bug Fixes
77
84
 
78
- * the index column no longer continues counting across renders; it is reset explicitly rather than by a side effect of deep-copying the table ([88b01f0](https://github.com/Opus-Perpetuus/prettyTables/commit/88b01f0))
79
- * `is_some_instance` returned None instead of False when nothing matched ([88b01f0](https://github.com/Opus-Perpetuus/prettyTables/commit/88b01f0))
85
+ * the index column no longer continues counting across renders; it is reset explicitly rather than by a side effect of deep-copying the table ([88b01f0](https://github.com/Opus-Perpetuus/flexablelib/commit/88b01f0))
86
+ * `is_some_instance` returned None instead of False when nothing matched ([88b01f0](https://github.com/Opus-Perpetuus/flexablelib/commit/88b01f0))
80
87
 
81
- ## [1.2.0](https://github.com/Opus-Perpetuus/prettyTables/compare/v1.1.5...v1.2.0) (2026-08-03)
88
+ ## [1.2.0](https://github.com/Opus-Perpetuus/flexablelib/compare/v1.1.5...v1.2.0) (2026-08-03)
82
89
 
83
90
 
84
91
  ### Features
85
92
 
86
- * ANSI colour for headers, borders, columns, rows and individual cells, with NO_COLOR and TTY detection ([f7ea1c9](https://github.com/Opus-Perpetuus/prettyTables/commit/f7ea1c9))
87
- * read from CSV, HTML, dicts, pandas and Excel; write CSV, Markdown, self-contained paginated HTML and Excel ([c54fa06](https://github.com/Opus-Perpetuus/prettyTables/commit/c54fa06))
88
- * parse numeric strings via `parse_str_numbers`, absorbing celulartable's type parsing ([ce5362b](https://github.com/Opus-Perpetuus/prettyTables/commit/ce5362b))
89
- * `max_width` and `too_narrow_message` for tables that cannot fit ([f8309b8](https://github.com/Opus-Perpetuus/prettyTables/commit/f8309b8))
90
- * `Table.missing` sentinel for building tables with gaps ([c54fa06](https://github.com/Opus-Perpetuus/prettyTables/commit/c54fa06))
93
+ * ANSI colour for headers, borders, columns, rows and individual cells, with NO_COLOR and TTY detection ([f7ea1c9](https://github.com/Opus-Perpetuus/flexablelib/commit/f7ea1c9))
94
+ * read from CSV, HTML, dicts, pandas and Excel; write CSV, Markdown, self-contained paginated HTML and Excel ([c54fa06](https://github.com/Opus-Perpetuus/flexablelib/commit/c54fa06))
95
+ * parse numeric strings via `parse_str_numbers`, absorbing celulartable's type parsing ([ce5362b](https://github.com/Opus-Perpetuus/flexablelib/commit/ce5362b))
96
+ * `max_width` and `too_narrow_message` for tables that cannot fit ([f8309b8](https://github.com/Opus-Perpetuus/flexablelib/commit/f8309b8))
97
+ * `Table.missing` sentinel for building tables with gaps ([c54fa06](https://github.com/Opus-Perpetuus/flexablelib/commit/c54fa06))
91
98
 
92
99
 
93
100
  ### Bug Fixes
94
101
 
95
- * measure and pad cells by visible width, fixing alignment for CJK, Hangul and emoji ([7a350d2](https://github.com/Opus-Perpetuus/prettyTables/commit/7a350d2))
96
- * exclude hidden rows from column width measurement ([#22](https://github.com/Opus-Perpetuus/prettyTables/issues/22)) ([e480f4e](https://github.com/Opus-Perpetuus/prettyTables/commit/e480f4e))
97
- * shrink the widest column first instead of every column in proportion ([#16](https://github.com/Opus-Perpetuus/prettyTables/issues/16)) ([842f64e](https://github.com/Opus-Perpetuus/prettyTables/commit/842f64e))
98
- * never hand a column a width budget of zero, which raised from textwrap ([#14](https://github.com/Opus-Perpetuus/prettyTables/issues/14)) ([842f64e](https://github.com/Opus-Perpetuus/prettyTables/commit/842f64e))
99
- * with auto_wrap off, the trimmed table now fits the terminal (Known Issue #2) ([842f64e](https://github.com/Opus-Perpetuus/prettyTables/commit/842f64e))
102
+ * measure and pad cells by visible width, fixing alignment for CJK, Hangul and emoji ([7a350d2](https://github.com/Opus-Perpetuus/flexablelib/commit/7a350d2))
103
+ * exclude hidden rows from column width measurement ([#22](https://github.com/Opus-Perpetuus/flexablelib/issues/22)) ([e480f4e](https://github.com/Opus-Perpetuus/flexablelib/commit/e480f4e))
104
+ * shrink the widest column first instead of every column in proportion ([#16](https://github.com/Opus-Perpetuus/flexablelib/issues/16)) ([842f64e](https://github.com/Opus-Perpetuus/flexablelib/commit/842f64e))
105
+ * never hand a column a width budget of zero, which raised from textwrap ([#14](https://github.com/Opus-Perpetuus/flexablelib/issues/14)) ([842f64e](https://github.com/Opus-Perpetuus/flexablelib/commit/842f64e))
106
+ * with auto_wrap off, the trimmed table now fits the terminal (Known Issue #2) ([842f64e](https://github.com/Opus-Perpetuus/flexablelib/commit/842f64e))
100
107
 
101
108
 
102
109
  ### Performance Improvements
103
110
 
104
- * C extension for text measurement, 17-34x on the hot path, with a pure-Python fallback ([23981d4](https://github.com/Opus-Perpetuus/prettyTables/commit/23981d4))
111
+ * C extension for text measurement, 17-34x on the hot path, with a pure-Python fallback ([23981d4](https://github.com/Opus-Perpetuus/flexablelib/commit/23981d4))
105
112
 
106
- ### [1.1.5](https://github.com/Opus-Perpetuus/prettyTables/compare/v1.1.4...v1.1.5) (2022-07-11)
113
+ ### [1.1.5](https://github.com/Opus-Perpetuus/flexablelib/compare/v1.1.4...v1.1.5) (2022-07-11)
107
114
 
108
115
 
109
116
  ### Bug Fixes
110
117
 
111
- * Wasn't possible to add empty rows. ([7a94a3f](https://github.com/Opus-Perpetuus/prettyTables/commit/7a94a3f94438ebdab16d21dd80d4c1bc66be872e))
118
+ * Wasn't possible to add empty rows. ([7a94a3f](https://github.com/Opus-Perpetuus/flexablelib/commit/7a94a3f94438ebdab16d21dd80d4c1bc66be872e))
112
119
 
113
- ### [1.1.4](https://github.com/Opus-Perpetuus/prettyTables/compare/v1.1.3...v1.1.4) (2022-07-11)
120
+ ### [1.1.4](https://github.com/Opus-Perpetuus/flexablelib/compare/v1.1.3...v1.1.4) (2022-07-11)
114
121
 
115
122
 
116
123
  ### Bug Fixes
117
124
 
118
- * Accidental import. ([47e798a](https://github.com/Opus-Perpetuus/prettyTables/commit/47e798a9019b918b47ace50d5fe5683864e5e886))
119
- * Auto trimming fixed. ([92e3a66](https://github.com/Opus-Perpetuus/prettyTables/commit/92e3a668fb931da0225b375d03c72f2ce9e357d0))
120
- * Auto-wrapping fixed. ([4b8d631](https://github.com/Opus-Perpetuus/prettyTables/commit/4b8d631dc9f7dbe65053e25b854dc61c7d6fbb64))
121
- * Autwrapping with index shown fixed. ([cbcb70c](https://github.com/Opus-Perpetuus/prettyTables/commit/cbcb70c8a08c5572553a3b46cad822cc316d5025))
122
- * Columns not showing wen passing less headers in class args. ([1559fe4](https://github.com/Opus-Perpetuus/prettyTables/commit/1559fe41f347130e44f07c67cdd464ca23f0cf68))
123
- * Passing extra headers causes an IndexError. ([e5a3e42](https://github.com/Opus-Perpetuus/prettyTables/commit/e5a3e427cf226d6eb4e58fb658d5068be1700edd))
124
- * Using rows and headers arguments gives error. ([0479cd5](https://github.com/Opus-Perpetuus/prettyTables/commit/0479cd569396db5a08c9b51be7816b53e0e0f8f9))
125
+ * Accidental import. ([47e798a](https://github.com/Opus-Perpetuus/flexablelib/commit/47e798a9019b918b47ace50d5fe5683864e5e886))
126
+ * Auto trimming fixed. ([92e3a66](https://github.com/Opus-Perpetuus/flexablelib/commit/92e3a668fb931da0225b375d03c72f2ce9e357d0))
127
+ * Auto-wrapping fixed. ([4b8d631](https://github.com/Opus-Perpetuus/flexablelib/commit/4b8d631dc9f7dbe65053e25b854dc61c7d6fbb64))
128
+ * Autwrapping with index shown fixed. ([cbcb70c](https://github.com/Opus-Perpetuus/flexablelib/commit/cbcb70c8a08c5572553a3b46cad822cc316d5025))
129
+ * Columns not showing wen passing less headers in class args. ([1559fe4](https://github.com/Opus-Perpetuus/flexablelib/commit/1559fe41f347130e44f07c67cdd464ca23f0cf68))
130
+ * Passing extra headers causes an IndexError. ([e5a3e42](https://github.com/Opus-Perpetuus/flexablelib/commit/e5a3e427cf226d6eb4e58fb658d5068be1700edd))
131
+ * Using rows and headers arguments gives error. ([0479cd5](https://github.com/Opus-Perpetuus/flexablelib/commit/0479cd569396db5a08c9b51be7816b53e0e0f8f9))
125
132
 
126
- ### [1.1.3](https://github.com/Opus-Perpetuus/prettyTables/compare/v1.1.2...v1.1.3) (2022-05-07)
133
+ ### [1.1.3](https://github.com/Opus-Perpetuus/flexablelib/compare/v1.1.2...v1.1.3) (2022-05-07)
127
134
 
128
135
 
129
136
  ### Bug Fixes
130
137
 
131
- * more accidental imports ([25e4c88](https://github.com/Opus-Perpetuus/prettyTables/commit/25e4c88e0feab8f154547ae159d0d7d8fff0750b))
138
+ * more accidental imports ([25e4c88](https://github.com/Opus-Perpetuus/flexablelib/commit/25e4c88e0feab8f154547ae159d0d7d8fff0750b))
132
139
 
133
- ### [1.1.2](https://github.com/Opus-Perpetuus/prettyTables/compare/v1.1.1...v1.1.2) (2022-05-07)
140
+ ### [1.1.2](https://github.com/Opus-Perpetuus/flexablelib/compare/v1.1.1...v1.1.2) (2022-05-07)
134
141
 
135
142
 
136
143
  ### Bug Fixes
137
144
 
138
- * accidental import. ([736ab4d](https://github.com/Opus-Perpetuus/prettyTables/commit/736ab4dc281cb766f9726512e3505a5bb17fc0cc))
145
+ * accidental import. ([736ab4d](https://github.com/Opus-Perpetuus/flexablelib/commit/736ab4dc281cb766f9726512e3505a5bb17fc0cc))
139
146
 
140
- ### [1.1.1](https://github.com/Opus-Perpetuus/prettyTables/compare/v1.1.0...v1.1.1) (2022-05-07)
147
+ ### [1.1.1](https://github.com/Opus-Perpetuus/flexablelib/compare/v1.1.0...v1.1.1) (2022-05-07)
141
148
 
142
149
 
143
150
  ### Bug Fixes
144
151
 
145
- * adding column of different size causing misplaced missing values. ([66abc50](https://github.com/Opus-Perpetuus/prettyTables/commit/66abc5082488c734ffd9329be09f9dc6ea86683b))
146
- * unintended info printing on console. ([560af0a](https://github.com/Opus-Perpetuus/prettyTables/commit/560af0aa8016ab71ad11f9f7ce29375543c192a9))
152
+ * adding column of different size causing misplaced missing values. ([66abc50](https://github.com/Opus-Perpetuus/flexablelib/commit/66abc5082488c734ffd9329be09f9dc6ea86683b))
153
+ * unintended info printing on console. ([560af0a](https://github.com/Opus-Perpetuus/flexablelib/commit/560af0aa8016ab71ad11f9f7ce29375543c192a9))
147
154
 
148
- ## [1.1.0](https://github.com/Opus-Perpetuus/prettyTables/compare/v1.0.0...v1.1.0) (2022-05-07)
155
+ ## [1.1.0](https://github.com/Opus-Perpetuus/flexablelib/compare/v1.0.0...v1.1.0) (2022-05-07)
149
156
 
150
157
 
151
158
  ### Features
152
159
 
153
- * added auto-wrapping for string columns. ([0cacdef](https://github.com/Opus-Perpetuus/prettyTables/commit/0cacdef34c738d0d611440ab393f474f37858ae3))
154
- * added float parsing and alignment ([1a65acd](https://github.com/Opus-Perpetuus/prettyTables/commit/1a65acd7a3fc7deb7331de4bed20a9d276d1a87d))
155
- * added show_index option ([8b8d328](https://github.com/Opus-Perpetuus/prettyTables/commit/8b8d328af591a7d0edd288d80af029837f300f81))
156
- * auto-wrap depends on the auto_wrap option. ([a1e09e5](https://github.com/Opus-Perpetuus/prettyTables/commit/a1e09e50ec913343b5b48b679cf08128ba74a383))
157
- * column data trimming added. ([f53503b](https://github.com/Opus-Perpetuus/prettyTables/commit/f53503bc0b1bf3bd342286ba5cb16354ab8ee4ab))
158
- * show_empty_columns, show_empty_rows options ([a7e4288](https://github.com/Opus-Perpetuus/prettyTables/commit/a7e428845254d68368e9bce6a7fbb4a59fe4046f))
160
+ * added auto-wrapping for string columns. ([0cacdef](https://github.com/Opus-Perpetuus/flexablelib/commit/0cacdef34c738d0d611440ab393f474f37858ae3))
161
+ * added float parsing and alignment ([1a65acd](https://github.com/Opus-Perpetuus/flexablelib/commit/1a65acd7a3fc7deb7331de4bed20a9d276d1a87d))
162
+ * added show_index option ([8b8d328](https://github.com/Opus-Perpetuus/flexablelib/commit/8b8d328af591a7d0edd288d80af029837f300f81))
163
+ * auto-wrap depends on the auto_wrap option. ([a1e09e5](https://github.com/Opus-Perpetuus/flexablelib/commit/a1e09e50ec913343b5b48b679cf08128ba74a383))
164
+ * column data trimming added. ([f53503b](https://github.com/Opus-Perpetuus/flexablelib/commit/f53503bc0b1bf3bd342286ba5cb16354ab8ee4ab))
165
+ * show_empty_columns, show_empty_rows options ([a7e4288](https://github.com/Opus-Perpetuus/flexablelib/commit/a7e428845254d68368e9bce6a7fbb4a59fe4046f))
159
166
 
160
167
 
161
168
  ### Bug Fixes
162
169
 
163
- * add_column omitting columns_with_i ([4cc900d](https://github.com/Opus-Perpetuus/prettyTables/commit/4cc900d25c494fbc2dcf4b58a7c7794c42d22b81))
164
- * auto-wrapping doesn't wrap columns "equally". ([9ba68ab](https://github.com/Opus-Perpetuus/prettyTables/commit/9ba68aba7c8c7494c33682368921802bc5167436))
165
- * empty column and row hiding working bad ([76979e9](https://github.com/Opus-Perpetuus/prettyTables/commit/76979e9b803491e6335cdcca8f7417f99abf8542))
166
- * float columns weren't considering header size ([f8ffce3](https://github.com/Opus-Perpetuus/prettyTables/commit/f8ffce38a2b97d409ca7ba37677280d8ff329c68))
167
- * header wrapping wasn't working ([09b5136](https://github.com/Opus-Perpetuus/prettyTables/commit/09b513653f89dc61331301c2be5b1506366d0fdc))
168
- * hiding empty r/c when showing i behaving bad ([823776a](https://github.com/Opus-Perpetuus/prettyTables/commit/823776ae5b1ca9b9210a8cd8337847a79fd5625f))
169
- * index displays incorrectly when hiding empty rows ([6054dda](https://github.com/Opus-Perpetuus/prettyTables/commit/6054ddae743df58907802c1467f8993d937c7df7))
170
- * large missing val. in float col. causes bad alignment ([565d58c](https://github.com/Opus-Perpetuus/prettyTables/commit/565d58c9db550d63d634c1f49c972a7c8beb7b8f))
171
- * missing value was a normal value and was affecting alignment ([a01d4fa](https://github.com/Opus-Perpetuus/prettyTables/commit/a01d4fa1b7dcc03f3ba78f31b9984ba7a7f4d334))
172
- * read_json not closing json ([6702f53](https://github.com/Opus-Perpetuus/prettyTables/commit/6702f5330f11d1f2a70b811e68f9a26447a065f6))
173
- * table with index wasn't auto-wrapping ([23457a5](https://github.com/Opus-Perpetuus/prettyTables/commit/23457a542733a40931f875db76f2a62939ffa93e))
174
- * when displaying index and adding rows table data messes up. ([3c0a724](https://github.com/Opus-Perpetuus/prettyTables/commit/3c0a7245dd09597ac46028bf31a03d37014c0ccc))
175
- * when showing i table data displays incomplete. ([b33ed42](https://github.com/Opus-Perpetuus/prettyTables/commit/b33ed42d064b1875e70357dedc1b2005ba396379))
176
- * wrapping wasn't working ([cf63647](https://github.com/Opus-Perpetuus/prettyTables/commit/cf63647a741dec0867cb702d75d16c3b0301d3e1))
170
+ * add_column omitting columns_with_i ([4cc900d](https://github.com/Opus-Perpetuus/flexablelib/commit/4cc900d25c494fbc2dcf4b58a7c7794c42d22b81))
171
+ * auto-wrapping doesn't wrap columns "equally". ([9ba68ab](https://github.com/Opus-Perpetuus/flexablelib/commit/9ba68aba7c8c7494c33682368921802bc5167436))
172
+ * empty column and row hiding working bad ([76979e9](https://github.com/Opus-Perpetuus/flexablelib/commit/76979e9b803491e6335cdcca8f7417f99abf8542))
173
+ * float columns weren't considering header size ([f8ffce3](https://github.com/Opus-Perpetuus/flexablelib/commit/f8ffce38a2b97d409ca7ba37677280d8ff329c68))
174
+ * header wrapping wasn't working ([09b5136](https://github.com/Opus-Perpetuus/flexablelib/commit/09b513653f89dc61331301c2be5b1506366d0fdc))
175
+ * hiding empty r/c when showing i behaving bad ([823776a](https://github.com/Opus-Perpetuus/flexablelib/commit/823776ae5b1ca9b9210a8cd8337847a79fd5625f))
176
+ * index displays incorrectly when hiding empty rows ([6054dda](https://github.com/Opus-Perpetuus/flexablelib/commit/6054ddae743df58907802c1467f8993d937c7df7))
177
+ * large missing val. in float col. causes bad alignment ([565d58c](https://github.com/Opus-Perpetuus/flexablelib/commit/565d58c9db550d63d634c1f49c972a7c8beb7b8f))
178
+ * missing value was a normal value and was affecting alignment ([a01d4fa](https://github.com/Opus-Perpetuus/flexablelib/commit/a01d4fa1b7dcc03f3ba78f31b9984ba7a7f4d334))
179
+ * read_json not closing json ([6702f53](https://github.com/Opus-Perpetuus/flexablelib/commit/6702f5330f11d1f2a70b811e68f9a26447a065f6))
180
+ * table with index wasn't auto-wrapping ([23457a5](https://github.com/Opus-Perpetuus/flexablelib/commit/23457a542733a40931f875db76f2a62939ffa93e))
181
+ * when displaying index and adding rows table data messes up. ([3c0a724](https://github.com/Opus-Perpetuus/flexablelib/commit/3c0a7245dd09597ac46028bf31a03d37014c0ccc))
182
+ * when showing i table data displays incomplete. ([b33ed42](https://github.com/Opus-Perpetuus/flexablelib/commit/b33ed42d064b1875e70357dedc1b2005ba396379))
183
+ * wrapping wasn't working ([cf63647](https://github.com/Opus-Perpetuus/flexablelib/commit/cf63647a741dec0867cb702d75d16c3b0301d3e1))
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flexablelib
3
- Version: 2.0.0
4
- Summary: Flexible Table Library — console tables
5
- Home-page: https://github.com/Opus-Perpetuus/prettyTables
3
+ Version: 2.0.1
4
+ Summary: Flexible console and HTML tables for Python
5
+ Home-page: https://github.com/Opus-Perpetuus/flexablelib
6
6
  Download-URL:
7
7
  Author: Benjamin Ramirez
8
8
  Author-email: chilerito12@gmail.com
@@ -52,7 +52,7 @@ Dynamic: summary
52
52
  </p>
53
53
 
54
54
  <p align="center">
55
- <em>Flexible Table Library — format tabular data with pretty styles.</em>
55
+ <em>Flexible Table Library — console and HTML tables for Python.</em>
56
56
  </p>
57
57
 
58
58
  <p align="center">
@@ -69,15 +69,7 @@ Dynamic: summary
69
69
 
70
70
  Flexible Table Library
71
71
 
72
- This is a python package that aims to provide a simple and pretty way of printing tables to the console making use of a class.
73
-
74
- The idea started as an attempt to reproduce the behavior of the [PM2](https://pm2.keymetrics.io) package when it displays tables to show data. Later, heavy inspiration came
75
- of two other python packages:
76
-
77
- - [Jazzband's](https://github.com/jazzband) [prettytable](https://github.com/jazzband/prettytable) (The names are similar by accident). Uses a class too.
78
- - [Astanin's](https://github.com/astanin) [tabulate](https://github.com/astanin/python-tabulate). A very simple to use and efficient package.
79
-
80
- A big part of the behavior of this package was replicated from these.
72
+ Python package for formatting tabular data as console and HTML tables: border styles, cell merges, ANSI colors, per-type and decimal alignment, width fitting, I/O helpers, and optional C-accelerated text measurement.
81
73
 
82
74
  # Installation
83
75
  ``pip install flexablelib`` on Windows.
@@ -326,23 +318,18 @@ from flexablelib.fast import implementation
326
318
  print(implementation()) # 'C extension' or 'pure Python'
327
319
  ```
328
320
 
329
- # Known Issues
330
-
331
- None of the three historical known issues remain:
321
+ # Notes
332
322
 
333
- - A column named ``"i"`` no longer collides with the index column
334
- (`utils.IndexColumnTitle`).
335
- - Exponential numbers align on the decimal / exponent axis with the rest of
336
- the float column.
337
- - Shrinking a float column drops decimals instead of chopping characters, so
338
- decimal alignment survives a terminal fit ([#23](https://github.com/Opus-Perpetuus/prettyTables/issues/23)).
323
+ - A column named ``"i"`` does not collide with the index column (`utils.IndexColumnTitle`).
324
+ - Exponential numbers align on the decimal / exponent axis with the rest of the float column.
325
+ - Shrinking a float column drops decimals instead of chopping characters, so decimal alignment survives a terminal fit ([#23](https://github.com/Opus-Perpetuus/flexablelib/issues/23)).
339
326
 
340
- Open work and the full issue map live in [docs/ISSUES.md](docs/ISSUES.md).
327
+ Open work and the issue map: [docs/ISSUES.md](docs/ISSUES.md).
341
328
 
342
329
  # Project Layout
343
330
 
344
331
  ```
345
- prettyTables/ # GitHub repository (name unchanged)
332
+ flexablelib/ # GitHub repository
346
333
  ├── flexablelib/ the Python package (no runtime dependencies)
347
334
  │ ├── __init__.py public API: Table, TableComposition, SeparatorLine
348
335
  │ ├── table.py the Table class — state and render orchestration
@@ -3,7 +3,7 @@
3
3
  </p>
4
4
 
5
5
  <p align="center">
6
- <em>Flexible Table Library — format tabular data with pretty styles.</em>
6
+ <em>Flexible Table Library — console and HTML tables for Python.</em>
7
7
  </p>
8
8
 
9
9
  <p align="center">
@@ -20,15 +20,7 @@
20
20
 
21
21
  Flexible Table Library
22
22
 
23
- This is a python package that aims to provide a simple and pretty way of printing tables to the console making use of a class.
24
-
25
- The idea started as an attempt to reproduce the behavior of the [PM2](https://pm2.keymetrics.io) package when it displays tables to show data. Later, heavy inspiration came
26
- of two other python packages:
27
-
28
- - [Jazzband's](https://github.com/jazzband) [prettytable](https://github.com/jazzband/prettytable) (The names are similar by accident). Uses a class too.
29
- - [Astanin's](https://github.com/astanin) [tabulate](https://github.com/astanin/python-tabulate). A very simple to use and efficient package.
30
-
31
- A big part of the behavior of this package was replicated from these.
23
+ Python package for formatting tabular data as console and HTML tables: border styles, cell merges, ANSI colors, per-type and decimal alignment, width fitting, I/O helpers, and optional C-accelerated text measurement.
32
24
 
33
25
  # Installation
34
26
  ``pip install flexablelib`` on Windows.
@@ -277,23 +269,18 @@ from flexablelib.fast import implementation
277
269
  print(implementation()) # 'C extension' or 'pure Python'
278
270
  ```
279
271
 
280
- # Known Issues
281
-
282
- None of the three historical known issues remain:
272
+ # Notes
283
273
 
284
- - A column named ``"i"`` no longer collides with the index column
285
- (`utils.IndexColumnTitle`).
286
- - Exponential numbers align on the decimal / exponent axis with the rest of
287
- the float column.
288
- - Shrinking a float column drops decimals instead of chopping characters, so
289
- decimal alignment survives a terminal fit ([#23](https://github.com/Opus-Perpetuus/prettyTables/issues/23)).
274
+ - A column named ``"i"`` does not collide with the index column (`utils.IndexColumnTitle`).
275
+ - Exponential numbers align on the decimal / exponent axis with the rest of the float column.
276
+ - Shrinking a float column drops decimals instead of chopping characters, so decimal alignment survives a terminal fit ([#23](https://github.com/Opus-Perpetuus/flexablelib/issues/23)).
290
277
 
291
- Open work and the full issue map live in [docs/ISSUES.md](docs/ISSUES.md).
278
+ Open work and the issue map: [docs/ISSUES.md](docs/ISSUES.md).
292
279
 
293
280
  # Project Layout
294
281
 
295
282
  ```
296
- prettyTables/ # GitHub repository (name unchanged)
283
+ flexablelib/ # GitHub repository
297
284
  ├── flexablelib/ the Python package (no runtime dependencies)
298
285
  │ ├── __init__.py public API: Table, TableComposition, SeparatorLine
299
286
  │ ├── table.py the Table class — state and render orchestration
@@ -44,7 +44,7 @@ def _add_cell_spacing(cell: Union[str, Union[List[str], Tuple[str]]],
44
44
  if is_some_instance(cell, tuple, list):
45
45
  # If it is, add the spacing to each part of the cell.
46
46
  spaced = list(map(str, cell)) # Convert to strings to prevent errors.
47
- for part_i, cell_part in enumerate(cell):
47
+ for part_i, cell_part in enumerate(spaced):
48
48
  # Add the spacing to the cell part.
49
49
  # FIX should consider the cell_part length
50
50
  if placeholder_size != 0 and part_i != 0:
@@ -54,10 +54,11 @@ def _add_cell_spacing(cell: Union[str, Union[List[str], Tuple[str]]],
54
54
  else:
55
55
  # If it is not, add the spacing to the cell.
56
56
  # FIX should consider the cell length
57
+ cell_text = str(cell)
57
58
  if placeholder_size != 0:
58
59
  spaced = ''.join([left, diff, right])
59
60
  else:
60
- spaced = ''.join([left, cell, right])
61
+ spaced = ''.join([left, cell_text, right])
61
62
 
62
63
  return spaced
63
64
 
@@ -725,6 +725,23 @@ def __align_single_cell(cell: Union[Any, List[Any], Tuple[Any]],
725
725
  float_column_sizes,
726
726
  DEFAULT_FILL_CHAR,
727
727
  )
728
+ elif to_where == COLUMN_ALIGNS.bytes:
729
+ # Bytes alignment is left-justified (see INDICATOR_RELATIONS). Without
730
+ # this branch the raw cell reaches _add_cell_spacing and TypeErrors on
731
+ # non-str values when callers set *_align / col_alignment to 'b'.
732
+ new_cell = _ljust_cell(
733
+ cell,
734
+ col_width,
735
+ DEFAULT_FILL_CHAR,
736
+ )
737
+ else:
738
+ # Unknown alignment code: still stringify and left-pad so compose()
739
+ # never blows up on a typo or a future alignment name.
740
+ new_cell = _ljust_cell(
741
+ cell,
742
+ col_width,
743
+ DEFAULT_FILL_CHAR,
744
+ )
728
745
  # Add the margin (if any) to the cell.
729
746
  new_cell = _add_cell_spacing(new_cell, margin, margin, 0)
730
747
 
@@ -1155,13 +1155,21 @@ class Table(object):
1155
1155
  def missing_value(self) -> Any:
1156
1156
  """
1157
1157
  A placeholder for empty cells.
1158
-
1158
+
1159
1159
  Default is::
1160
-
1160
+
1161
1161
  ''
1162
+
1163
+ ``missing_val`` is an alias of this attribute (same name as the
1164
+ ``Table(..., missing_val=...)`` constructor argument).
1162
1165
  """
1163
1166
  return self.__missing_value
1164
1167
 
1168
+ @property
1169
+ def missing_val(self) -> Any:
1170
+ """Alias of :attr:`missing_value`."""
1171
+ return self.__missing_value
1172
+
1165
1173
  @property
1166
1174
  def str_align(self):
1167
1175
  """
@@ -1523,6 +1531,10 @@ class Table(object):
1523
1531
  def missing_value(self, value):
1524
1532
  self.__missing_value = value
1525
1533
 
1534
+ @missing_val.setter
1535
+ def missing_val(self, value):
1536
+ self.__missing_value = value
1537
+
1526
1538
  @str_align.setter
1527
1539
  def str_align(self, value):
1528
1540
  self.__str_align = self.__checked_alignment(value, 'str_align')
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flexablelib
3
- Version: 2.0.0
4
- Summary: Flexible Table Library — console tables
5
- Home-page: https://github.com/Opus-Perpetuus/prettyTables
3
+ Version: 2.0.1
4
+ Summary: Flexible console and HTML tables for Python
5
+ Home-page: https://github.com/Opus-Perpetuus/flexablelib
6
6
  Download-URL:
7
7
  Author: Benjamin Ramirez
8
8
  Author-email: chilerito12@gmail.com
@@ -52,7 +52,7 @@ Dynamic: summary
52
52
  </p>
53
53
 
54
54
  <p align="center">
55
- <em>Flexible Table Library — format tabular data with pretty styles.</em>
55
+ <em>Flexible Table Library — console and HTML tables for Python.</em>
56
56
  </p>
57
57
 
58
58
  <p align="center">
@@ -69,15 +69,7 @@ Dynamic: summary
69
69
 
70
70
  Flexible Table Library
71
71
 
72
- This is a python package that aims to provide a simple and pretty way of printing tables to the console making use of a class.
73
-
74
- The idea started as an attempt to reproduce the behavior of the [PM2](https://pm2.keymetrics.io) package when it displays tables to show data. Later, heavy inspiration came
75
- of two other python packages:
76
-
77
- - [Jazzband's](https://github.com/jazzband) [prettytable](https://github.com/jazzband/prettytable) (The names are similar by accident). Uses a class too.
78
- - [Astanin's](https://github.com/astanin) [tabulate](https://github.com/astanin/python-tabulate). A very simple to use and efficient package.
79
-
80
- A big part of the behavior of this package was replicated from these.
72
+ Python package for formatting tabular data as console and HTML tables: border styles, cell merges, ANSI colors, per-type and decimal alignment, width fitting, I/O helpers, and optional C-accelerated text measurement.
81
73
 
82
74
  # Installation
83
75
  ``pip install flexablelib`` on Windows.
@@ -326,23 +318,18 @@ from flexablelib.fast import implementation
326
318
  print(implementation()) # 'C extension' or 'pure Python'
327
319
  ```
328
320
 
329
- # Known Issues
330
-
331
- None of the three historical known issues remain:
321
+ # Notes
332
322
 
333
- - A column named ``"i"`` no longer collides with the index column
334
- (`utils.IndexColumnTitle`).
335
- - Exponential numbers align on the decimal / exponent axis with the rest of
336
- the float column.
337
- - Shrinking a float column drops decimals instead of chopping characters, so
338
- decimal alignment survives a terminal fit ([#23](https://github.com/Opus-Perpetuus/prettyTables/issues/23)).
323
+ - A column named ``"i"`` does not collide with the index column (`utils.IndexColumnTitle`).
324
+ - Exponential numbers align on the decimal / exponent axis with the rest of the float column.
325
+ - Shrinking a float column drops decimals instead of chopping characters, so decimal alignment survives a terminal fit ([#23](https://github.com/Opus-Perpetuus/flexablelib/issues/23)).
339
326
 
340
- Open work and the full issue map live in [docs/ISSUES.md](docs/ISSUES.md).
327
+ Open work and the issue map: [docs/ISSUES.md](docs/ISSUES.md).
341
328
 
342
329
  # Project Layout
343
330
 
344
331
  ```
345
- prettyTables/ # GitHub repository (name unchanged)
332
+ flexablelib/ # GitHub repository
346
333
  ├── flexablelib/ the Python package (no runtime dependencies)
347
334
  │ ├── __init__.py public API: Table, TableComposition, SeparatorLine
348
335
  │ ├── table.py the Table class — state and render orchestration
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "flexablelib",
3
- "version": "2.0.0",
4
- "description": "Flexible Table Library \u2014 format tabular data for the console.",
3
+ "version": "2.0.1",
4
+ "description": "Flexible console and HTML tables for Python: styles, merges, colors, widths, decimal alignment.",
5
5
  "main": "__init__.py",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -12,14 +12,14 @@
12
12
  },
13
13
  "repository": {
14
14
  "type": "git",
15
- "url": "git+https://github.com/Opus-Perpetuus/prettyTables.git"
15
+ "url": "git+https://github.com/Opus-Perpetuus/flexablelib.git"
16
16
  },
17
17
  "author": "Kyostenas",
18
18
  "license": "MIT",
19
19
  "bugs": {
20
- "url": "https://github.com/Opus-Perpetuus/prettyTables/issues"
20
+ "url": "https://github.com/Opus-Perpetuus/flexablelib/issues"
21
21
  },
22
- "homepage": "https://github.com/Opus-Perpetuus/prettyTables#readme",
22
+ "homepage": "https://github.com/Opus-Perpetuus/flexablelib#readme",
23
23
  "config": {
24
24
  "commitzen": {
25
25
  "path": "cz-conventional-changelog"
@@ -18,12 +18,12 @@ setup(
18
18
  name = 'flexablelib',
19
19
  packages = ['flexablelib'],
20
20
  version = read_json(f'.{os.sep}package.json')['version'],
21
- description = 'Flexible Table Library — console tables',
21
+ description = 'Flexible console and HTML tables for Python',
22
22
  long_description=read_file('README.md'),
23
23
  long_description_content_type='text/markdown',
24
24
  author = 'Benjamin Ramirez',
25
25
  author_email = 'chilerito12@gmail.com',
26
- url = 'https://github.com/Opus-Perpetuus/prettyTables',
26
+ url = 'https://github.com/Opus-Perpetuus/flexablelib',
27
27
  license='MIT',
28
28
  download_url = '',
29
29
  keywords = ['console', 'graphics'],
@@ -216,3 +216,43 @@ def test_the_package_can_be_star_imported():
216
216
  assert 'Table' in namespace
217
217
  assert 'TableComposition' in namespace
218
218
  assert 'SeparatorLine' in namespace
219
+
220
+
221
+ def test_bytes_alignment_code_renders_without_typeerror():
222
+ """``COLUMN_ALIGNS.bytes`` ('b') must justify like left, not crash.
223
+
224
+ Forcing ``*_align`` / ``col_alignment`` to ``'b'`` used to skip every
225
+ justify branch in ``__align_single_cell``, so the raw int/bytes cell hit
226
+ ``_add_cell_spacing`` and raised ``TypeError``.
227
+ """
228
+ table = Table()
229
+ table.add_column('Name', ['Jade', 'John'])
230
+ table.add_column('Age', [20, 30])
231
+ table.add_column('Blob', [b'abc', b'xy'])
232
+ table.col_alignment = 'b'
233
+ rendered = str(table)
234
+ assert 'Jade' in rendered
235
+ assert '20' in rendered
236
+ assert "b'abc'" in rendered or 'abc' in rendered
237
+
238
+ only_bytes = Table()
239
+ only_bytes.add_column('Blob', [b'hello', b'world'])
240
+ only_bytes.col_alignment = 'b'
241
+ assert 'hello' in str(only_bytes)
242
+
243
+ ints = Table()
244
+ ints.add_column('n', [1, 2, 3])
245
+ ints.int_align = 'b'
246
+ assert '1' in str(ints)
247
+
248
+
249
+ def test_missing_val_alias_matches_missing_value():
250
+ table = Table()
251
+ table.add_column('a', ['x'])
252
+ table.add_row([])
253
+ table.missing_val = 'n/a'
254
+ assert table.missing_value == 'n/a'
255
+ assert 'n/a' in str(table)
256
+ table.missing_value = '?'
257
+ assert table.missing_val == '?'
258
+ assert '?' in str(table)
File without changes
File without changes
File without changes