DashTable
Video Tutorial
Introduction
Use DashTable to create ASCII tables like this reStructured Table:
+------------+------------+------------+ | Header 1 | Header 2 | Header 3 | +============+============+============+ | body row 1 | column 2 | column 3 | +------------+------------+------------+ | body row 2 | Cells may span columns. | +------------+------------+------------+ | body row 3 | Cells may | - Cells | +------------+ span rows. | - contain | | body row 4 | | - blocks. | +------------+------------+------------+
Installation
pip install dashtable
Example Usage
HTML to reStructured Table
html2rst requires a filepath or a string to work.
from dashtable import html2rst
filepath = "path/to/html/file.html"
print(html2rst(filepath, force_headers=False, center_cells=False))
Command Line Method:
python html2rst.py input.html output.rst --force_headers --center_cells --center_headers
HTML to MarkDown Table
html2md requires a filepath or a string to work.
from dashtable import html2md
filepath = "path/to/html/file.html"
print(html2md(filepath))
Command line method:
python html2md.py input.html output.md
List of Lists to reStructered Table
from dashtable import data2rst
table = [
['Row\nSpan', 'Header'],
['Cell', ''],
['Column Span', '']
]
column_span = ([0, 0], [1, 0])
row_span = ([2, 0], [2, 1])
my_spans = [column_span, row_span]
print(data2rst(table, spans=my_spans, use_headers=True, center_cells=False, center_headers=True))
List of Lists to Markdown Table
from dashtable import data2md
table = [
['Header 1', 'Header 2', 'Header 3'],
['Column 1', 'Column 2', 'Column 3']
]
print(data2md(table))
Metadata
Release files for dashtable 1.3.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dashtable-1.3.8.tar.gz | 9.3 kB | Without provenance | Details for dashtable-1.3.8.tar.gz |
Release files / dashtable-1.3.8.tar.gz
| Download URL | dashtable-1.3.8.tar.gz |
|---|---|
| Size | 9.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
87cf60c84f51c5cebca941a47fff80292d06743006a9f37cfbbea7ffac7a30f7
|
|
BLAKE2b-256 checksum How to use checksums |
882279b18c06c937663baa4781d59537a20dd368667236515b7491aab5a0af9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for dashtable 1.3.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.