Skip to main content

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:

  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.

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

markdown_table_repair-0.1.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

markdown_table_repair-0.1.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

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

Hashes for markdown_table_repair-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d5a3fd18c7117f313acdf0cd65bfc734804bd89fc411d03552a6038a84145a10
MD5 c389942d1a5db9bd78dbc5991aeda18d
BLAKE2b-256 6e324dd957c7ebc61552ca8193ab582b97688c6b2404e060fbf9fe9c445efebd

See more details on using hashes here.

File details

Details for the file markdown_table_repair-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for markdown_table_repair-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 11c7d5da9ba4fa0bc24f5f6843b04baede519583f369e4bd1df05c0ab29447e4
MD5 e861f18fdf170ac81668177f0648a2b9
BLAKE2b-256 19b42b4e538771c88557438c89a84e879c1c3f5eece89524d35e88ed5ccd74a5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page