Skip to main content

🛠️ 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:

  1. Install the Package Before using markdown-table-repair, ensure that pandas is installed.
pip install markdown-table-repair  
  1. 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)
  1. 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.

Metadata

Release files for markdown-table-repair 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for markdown-table-repair 0.1.0
File Size Uploaded
markdown_table_repair-0.1.0.tar.gz 4.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for markdown-table-repair 0.1.0
File Interpreter ABI Platform
markdown_table_repair-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.3 kB

Release files / markdown_table_repair-0.1.0.tar.gz

Download URL markdown_table_repair-0.1.0.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d5a3fd18c7117f313acdf0cd65bfc734804bd89fc411d03552a6038a84145a10
BLAKE2b-256 checksum
How to use checksums
6e324dd957c7ebc61552ca8193ab582b97688c6b2404e060fbf9fe9c445efebd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Release files / markdown_table_repair-0.1.0-py3-none-any.whl

Download URL markdown_table_repair-0.1.0-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
11c7d5da9ba4fa0bc24f5f6843b04baede519583f369e4bd1df05c0ab29447e4
BLAKE2b-256 checksum
How to use checksums
19b42b4e538771c88557438c89a84e879c1c3f5eece89524d35e88ed5ccd74a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page