skillfed

py-markdown-table

Package that generates markdown tables from a list of dicts

py-markdown-table v1.3.0 814.1K downloads/30d#4,993 on PyPI51
Permissive license MIT Active released

What it is and what it does

py-markdown-table is a lightweight Python library that converts lists of dictionaries into formatted markdown tables. It takes uniform dictionaries (where all dicts have the same keys) and renders them as markdown-formatted tables with the dict keys becoming column headers and the values becoming rows.

The library offers granular control over table formatting through a chainable `set_params()` method, allowing you to configure row separators (always, topbottom, markdown, or none), per-column or global padding width and alignment (left, right, centerleft, centerright), custom padding and newline characters, float rounding precision, emoji spacing, and multiline column widths. It integrates easily with pandas by converting dataframes to dict records first.

Use it for:

  • Generate markdown documentation tables from structured data programmatically
  • Format API response data or database query results as readable markdown for reports
  • Convert pandas DataFrames to markdown tables for embedding in markdown files or READMEs
  • Create aligned, padded tables in CLI tools that output markdown-formatted text
  • Build markdown tables with custom column widths and text wrapping for long content

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Generates formatted markdown tables from lists of dictionaries, with support for padding, alignment, multiline text, and float rounding.

Yes. Zero dependencies, active maintenance, permissive license, and broad Python version support (3.8–3.13) make it a low-risk choice. Install if you need to programmatically generate markdown tables from structured data; the formatting options are substantial enough for most use cases.

Install

py-markdown-table on PyPI

pip

pip install py-markdown-table

uv

uv add py-markdown-table

poetry

poetry add py-markdown-table

Installing py-markdown-table

Before you install

Low friction: pure Python wheel with zero runtime dependencies and active maintenance (last commit 2026-07-25). Supports Python 3.8 through 3.13.

License in practice

MIT license (permissive) places no restrictions on use, modification, or distribution.

Quickstart

pip install py-markdown-table

from py_markdown_table.markdown_table import markdown_table
data = [{"Product": "Smartphone", "Brand": "Apple", "Price": 999.99}]
markdown = markdown_table(data).get_markdown()
print(markdown)

Verify before relying

  • Whether the package handles edge cases like empty data, None values, or non-uniform dict keys gracefully
  • Performance characteristics with very large tables or deeply nested multiline content

Package facts

License MIT (permissive)
Python support supports the current Python release (<4.0,>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 554 days since the last release
Last repo commit
First released
Downloads 814,131/month — #4,993 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: py_markdown_table-1.3.0-py3-none-any.whl

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

markdown table generatorconvert dict to markdown tableformat data as markdownpython markdown tabletable formatting librarymarkdown table from listgenerate markdown tables
markdowntable-generationdata-formatting

More Markup packages