Skip to main content

Extension for doakey3/DashTable

Project description

dashtable-ext

Shitty Extension to doakey3/DashTable

Installation

$ pip install -U dashtable-ext

RST 2 ASCII:

+-----------+-----------+-----------------------+
| Heading 1 | Heading 2 | Heading 3             |
|           +-----------+-----------+-----------+
|           | Heading 4 | Heading 5 | Heading 6 |
+===========+-----------+-----------+-----------+
| A         | B         | C                     |
|           +-----------+                       |
|           | D         |                       |
|           +-----------+-----------+-----------+
|           | E         | F         | G         |
+-----------+-----------+-----------+-----------+
| H                     | I         | J         |
+-----------------------+-----------+           |
| K                     | L         |           |
|                       +-----------+-----------+
|                       | M         | N         |
+-----------------------+-----------+-----------+
from dashtable.ext import rst2ascii, PresetStyle
import dashtable

with open("table.html", "r") as f:
    html = f.read()

table = dashtable.html2rst(html)
print(rst2ascii(table = table, preset=PresetStyle.thin_thick_rounded))

Output:

╭───────────┬───────────┬───────────────────────╮
│ Heading 1  Heading 2  Heading 3             │
│           ├───────────┼───────────┬───────────┤
│            Heading 4  Heading 5  Heading 6 │
├━━━━━━━━━━━┼───────────┼───────────┴───────────┤
│ A          B          C                     │
│           ├───────────┤                       │
│            D                                │
│           ├───────────┼───────────┬───────────┤
│            E          F          G         │
├───────────┴───────────┼───────────┼───────────┤
│ H                      I          J         │
├───────────────────────┼───────────┤           │
│ K                      L                    │
│                       ├───────────┼───────────┤
│                        M          N         │
╰───────────────────────┴───────────┴───────────╯

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

dashtable-ext-1.0.0.tar.gz (5.1 kB view hashes)

Uploaded Source

Built Distribution

dashtable_ext-1.0.0-py3-none-any.whl (5.2 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