Skip to main content

Convert a list of dictionaries to a markdown formatted table.

Project description

tomark

A Python module that converts a list of dictionaries to a markdown formatted table.

Note: Each dict in the list must have the same number of elements.

Installing

!python3 -m pip install --upgrade tomark

Usage:

from tomark import Tomark

data = [
  {
    'pr': 291, 
    'status': 'closed', 
    'date': 'None', 
    'title': 'Adds new wiz bang feature'
  },
  {
    'pr': 290, 
    'status': 'v1.0', 
    'date': 'None', 
    'title': 'Updates UI to be more awesome'
  }
]

markdown = Tomark.table(data)
print(markdown)

Example table output:

PR Status Date Title
292 open None Adds new wiz bang feature
286 v1.0 None Updates UI to be more awesome

Example raw ouput:

| PR  | Status | Date | Title |
|----|----|----|----|
| 292 | open | None | Adds new wiz bang feature |
| 286 | v1.0 | None | Updates UI to be more awesome |

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tomark-0.1.4.tar.gz (2.0 kB view hashes)

Uploaded Source

Built Distribution

tomark-0.1.4-py3-none-any.whl (2.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page