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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mdpd-0.2.1.tar.gz.
File metadata
- Download URL: mdpd-0.2.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
041bcd0faabddc8982f70432b71ebe033442f6d495ae4026678ace1b8c4f9897
|
|
| MD5 |
c586689724c0c61befc744a49de393d5
|
|
| BLAKE2b-256 |
2fecb31ac809b79e1baa0550e60325273ef437fdde77a65aaa68bdc2b3e82ef9
|
File details
Details for the file mdpd-0.2.1-py3-none-any.whl.
File metadata
- Download URL: mdpd-0.2.1-py3-none-any.whl
- Upload date:
- Size: 3.4 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7735776f1fa96ac318e89e536aa0e8a9a896163e042d57b1e1c43298d6f6fc26
|
|
| MD5 |
1da51f13a4bb5024babf3331afb0fa37
|
|
| BLAKE2b-256 |
d79cf8c498687901bf5c39e05015ea17e689d7f5e68b19a0d5e0c22edb309997
|