Skip to main content

a simpler tool for convert markdown table to pandas

Project description

mdpd

mdpd is a simpler tool for convert markdown table to pandas. This tool is a lightweight tool for testing a code, so note that we are not validating the user's input.

install

pip install mdpd

usage

import mdpd

df = mdpd.from_md("""
+------------+-------+
| id         | score |
+------------+-------+
| 1          | 15    |
| 2          | 11    |
| 3          | 11    |
| 4          | 20    |
+------------+-------+
""")

print(df)
#   id score
# 0  1    15
# 1  2    11
# 2  3    11
# 3  4    20
# the header can be overwritten if the header exists
import mdpd
df = mdpd.from_md("""
| 1          | 15    |
| 2          | 11    |
| 3          | 11    |
| 4          | 20    |
""", header=["id", "score"])

print(df)
#   id score
# 0  1    15
# 1  2    11
# 2  3    11
# 3  4    20

accepted table patterns

| Syntax    | Description |
| --------- | ----------- |
| Header    | Title       |
| Paragraph | Text        |
+------------+-------------+
| Syntax     | Description |
+------------+-------------+
| Header     | Title       |
| Paragraph  | Text        |
+------------+-------------+
| Syntax    | Description |
| :-------- | ----------: |
| Header    | Title       |
| Paragraph | Text        |
| Header    | Title       |
| Paragraph | Text        |

contribute

If you have suggestions for features or improvements to the code, please feel free to create an issue or PR.

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

mdpd-0.2.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

mdpd-0.2.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file mdpd-0.2.0.tar.gz.

File metadata

  • Download URL: mdpd-0.2.0.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.9.13 Linux/6.2.0-1012-azure

File hashes

Hashes for mdpd-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9c5c3ae96b959ec9beadd4b604e351c44e4c6270e5251bc78585d8631c22d6ef
MD5 2b720c3bef075b4555ca2f4b28ea31dc
BLAKE2b-256 7fee5f2aaa1c7c0cc24677efcfbbdc6baa4f0e1c1659e0dcdd23a0c3dc869059

See more details on using hashes here.

File details

Details for the file mdpd-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: mdpd-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.9.13 Linux/6.2.0-1012-azure

File hashes

Hashes for mdpd-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b6aef458bd56cf0978ac9cdcaba103c66f25a3846c986342c524da231b699724
MD5 ffa233b0278d672e3083af37088f6a71
BLAKE2b-256 580b347b23538a2d4c911383fb9ebd0b5cc27364ffceadb20a665b39945b04b4

See more details on using hashes here.

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