Repository navigation
Everything merged since 1.3.0 (2025-02-06).
Breaking
- Python 3.8 and 3.9 are dropped;
requires-pythonis>=3.10(#41). - A width given to
multilineis the space left for content, andpadding_widthis added on top
of it. Before, the two were compared against the whole column, so the same value wrapped at
padding_width=0and silently overran its column at any larger padding (#45). - Nothing is written back into the caller's objects.
set_params()andget_markdown()used to
mutate thedatarows and themultiline,padding_widthandpadding_weightdictionaries
passed in, and re-widened the columns on every call, so rendering the same object twice produced
a different table each time (#43). - Values that are not strings are rendered as strings in every mode.
multilineand
emoji_spacing="mono"used to raiseAttributeErrororTypeErroron anint,floator
Nonecell, while the plain path accepted them (#43). - Option values that cannot be honoured raise
ValueErrornaming the offender instead of
producing a broken table (#43, #45, #49):- a per-column
padding_width,padding_weightormultilinedict whose keys are not exactly
the columns of the data, previouslyKeyError: 'col'; padding_chargiven a dict, previously accepted and ignored;float_roundingbelow zero, which rounded floats to tens;- a column name wider than the column it names under
multiline_strategy="rows", previously
written past the border; - a word wider than its
multilinecolumn, which could also spin the wrapping loop forever; - a line break in a value whose column has no
multilinewidth, previously split across two
output lines.
- a per-column
\r\nand a lone\rinside a value are normalised to\n, so a line break means a line break
whichever platform produced the data (#49).from py_markdown_table import markdown_tableyields the class; it used to yield the submodule
of the same name (#43).
Added
compactoption, which emits the smallest table that is still valid markdown - no padding and
one-per column in the separator - for output that has to fit a size limit (#50, closes #24).- Every function in the package is annotated and a
py.typedmarker is shipped, so type checkers
see the real signature ofdataandset_params(#51, closes #26). MarkdownTableas the PEP 8 spelling of the class name; the lowercase name stays primary (#43).- Test suite from 18 to 177 tests, coverage 86% to 95%, including the invariant that a rendered
table is a rectangle, andmypyin CI (#44, #46, #51).
Changed
emoji_spacing="mono"decides what is two columns wide fromunicodedata.east_asian_width
instead of twelve hand-maintained code point ranges (#48, closes #20). Arrows, dingbats and
misc symbols (→ ★ ☀ ✓) are no longer widened, astral emoji outside the old ranges are,
a base character followed by U+FE0F is counted, and CJK is padded correctly.- Packaging and publishing use
uvinstead of Poetry (#32), coverage is collected on every push
rather than only on tags (#35), and the CI matrix covers 3.10 through 3.15 (#33). - A custom
multiline_delimiteris used when rejoining wrapped text; the wrapper used to insert a
space regardless of the delimiter (#45). - The README's keyword table and every shown example output are generated from the code, and the
examples define the data they render (#47, #53).
Fixed
utils/benchmark.pysized its columns from cell values only, so the header was written past the
border;include_headeris now passed (#53).- The
.venventry restored in.gitignore(#38), and the status badge pointed at the workflow
that actually runs (#36).
Install: pip install py-markdown-table==2.0.0 (python 3.10+).