Markdown Table Generator

1.3.0 · active · verified Mon Apr 13

py-markdown-table is an active Python library, currently at version 1.3.0, designed to generate formatted markdown tables from a list of dictionaries. It boasts zero dependencies and releases updates periodically, addressing bug fixes and enhancing formatting options.

Warnings

Install

Imports

Quickstart

This example demonstrates how to create a basic markdown table from a list of dictionaries. The keys of the dictionaries become the column headers, and the values form the rows of the table.

from py_markdown_table.markdown_table import markdown_table

data = [
    {"Product": "Smartphone", "Brand": "Apple", "Price": 999.99},
    {"Product": "Laptop", "Brand": "Dell", "Price": 1299.99}
]

markdown = markdown_table(data).get_markdown()
print(markdown)

view raw JSON →