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)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|