Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kyoto7250/mdpd
a simple tool for convert markdown table to pandas
https://github.com/kyoto7250/mdpd
development markdown pandas python3 test
Last synced: 3 months ago
JSON representation
a simple tool for convert markdown table to pandas
- Host: GitHub
- URL: https://github.com/kyoto7250/mdpd
- Owner: kyoto7250
- License: mit
- Created: 2023-10-07T06:20:04.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-14T14:05:59.000Z (3 months ago)
- Last Synced: 2024-11-14T15:19:04.445Z (3 months ago)
- Topics: development, markdown, pandas, python3, test
- Language: Python
- Homepage: https://pypi.org/project/mdpd/
- Size: 137 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```bash
pip install mdpd
```## usage
```python
import mdpddf = 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
``````python
# 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
```markdown
| Syntax | Description |
| --------- | ----------- |
| Header | Title |
| Paragraph | Text |
``````markdown
+------------+-------------+
| Syntax | Description |
+------------+-------------+
| Header | Title |
| Paragraph | Text |
+------------+-------------+
``````markdown
| Syntax | Description |
| :-------- | ----------: |
| Header | Title |
| Paragraph | Text |
``````markdown
| 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.