A package to repair and clean malformed markdown tables.
Project description
🛠️ Markdown Table Repair
markdown-table-repair is a python package designed to repair and clean malformed markdown tables and convert them into structured pandas.
✨ Supported Broken Markdown Table Format
- Inconsistent column and header count
Header1 | Header2 |
|---|---|
Value1 | Value2 | Value3
- Improperly formatted header
| Header1 | Header2 | Header3
|---|---|---
Value1 | Value2 | Value3 |
- Missing separator
| Header1 | Header2 | Header3
Value1 | Value3
- Unclosed table blocks
| Header1 | Header2 | Header3
|---|---|---
Value1 | Value2 | Value3
- No separator in header row
Header1 | Header2 |
|---|---|
Value1 | Value2 | Value3
- Unnecessary whitespaces
- etc.
🔧 Usage
To use the markdown-table-repair package, follow these steps:
- Install the Package
Before using markdown-table-repair, ensure that
pandasis installed.
pip install markdown-table-repair
- Repair Malformed Tables
import markdown_table_repair as mtr
malformed_table = """| Header1 | Header2 | Header3 \n|---|---|\n Value1 | Value2 | Value3"""
repaired_table = mtr.repair(malformed_table)
print(repaired_table)
- Optional - Convert to DataFrame
# If you want to convert the repaired table into a pandas DataFrame
dataframe = repaired_table.to_df()
🤝 Contributing
Your contributions to this project are welcome! Feel free to fork the repository, create pull requests, and help improve the markdown-table-repair package.
📝 License
This project is licensed under the MIT License. See the LICENSE file for details.
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 markdown_table_repair-0.1.0.tar.gz.
File metadata
- Download URL: markdown_table_repair-0.1.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5a3fd18c7117f313acdf0cd65bfc734804bd89fc411d03552a6038a84145a10
|
|
| MD5 |
c389942d1a5db9bd78dbc5991aeda18d
|
|
| BLAKE2b-256 |
6e324dd957c7ebc61552ca8193ab582b97688c6b2404e060fbf9fe9c445efebd
|
File details
Details for the file markdown_table_repair-0.1.0-py3-none-any.whl.
File metadata
- Download URL: markdown_table_repair-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11c7d5da9ba4fa0bc24f5f6843b04baede519583f369e4bd1df05c0ab29447e4
|
|
| MD5 |
e861f18fdf170ac81668177f0648a2b9
|
|
| BLAKE2b-256 |
19b42b4e538771c88557438c89a84e879c1c3f5eece89524d35e88ed5ccd74a5
|