Skip to main content

format data to Table

Output table

  • reStructuredText

  • Markdown

  • html

  • csv

  • pandas.dataframe

Read table from

  • html

  • csv

  • rst

  • md

Example

data = [
    [h, h, h...], # header = 1
    [d, d, d...],
    [d, d, d...],
    ...
]

table = MarkupTable(data, header=1)
print(table.to_rst())
print(table.to_md())
print(table.to_csv('csv_file'))

table.append_row(['a', 'b', 'c', 'd', 'e'])
table.set_align('center', rows=[0])
table.set_align('left',rows=range(1, table.row_count(), columns=[3])
table.set_align('right',rows=range(1, table.row_count(), columns=[4])

table.set_format(lambda x: '{:,.2f} %'.format(x), rows=range(1, table.row_count()), columns=[4])

table = MarkupTable.from_html(open('html_file').read())
print(table.to_rst())

table = MarkupTable.from_csv(open('csv_file').read())
print(table.to_rst())

Release files for mtable 0.2.22

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for mtable 0.2.22
File Interpreter ABI Platform
mtable-0.2.22-py3-none-any.whl Python 3 none any Details

Release files / mtable-0.2.22-py3-none-any.whl

Download URL mtable-0.2.22-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1488f81a2eca70a952370d796303a48921b904fedb65e12236d91ff26fd16c95
BLAKE2b-256 checksum
How to use checksums
6c56ae07b3398cabb6fb387f7f3578ae84c693cc13674c591dcc1d7596d6b34a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.5

Release history Release notifications | RSS feed

This release

0.2.22 This release

1 release file

0.1.22

1 release file

0.1.10

1 release file

0.1.9

1 release file

0.1.8

1 release file

0.1.7

1 release file

0.1.6

1 release file

0.1.4

1 release file

0.1.2

1 release file

0.1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page