Skip to main content

Parse complex tables from CSV, XLSX, and DOCX into JSON/Markdown/HTML)

Project description

table2llm

Parse complex tables from CSV, XLSX, and DOCX into LLM-friendly formats such as JSON, Markdown, and HTML.


Features

  • Supports:
    • CSV
    • XLSX (Excel)
    • DOCX (Word tables)
  • Handles:
    • Merged cells (rowspan / colspan)
    • Nested tables (DOCX)
  • Outputs:
    • JSON (structured records)
    • Markdown
    • HTML

Installation

pip install table2llm


Usage

Unified API (Recommended)

from table2llm import unpack

result = unpack("data.csv", output_format="json")
print(result)

result = unpack("data.xlsx", output_format="md")
print(result)

result = unpack("data.docx", output_format="html")
print(result)

Direct Parser API

from table2llm import CsvParser, DocxParser, XlsxParser

csv_result = CsvParser().parse_to_json("data.csv")
xlsx_result = XlsxParser().parse_to_md("data.xlsx")
docx_result = DocxParser().parse_to_html("data.docx")

print(csv_result)
print(xlsx_result)
print(docx_result)

Output Formats

JSON

  • Structured as list of records
  • Suitable for LLM ingestion

Markdown

  • Clean table format
  • Useful for prompts or documentation

HTML

  • Preserves structure (rowspan / colspan)
  • Best for rendering

Notes

  • Choose parser based on file type
  • Empty rows are skipped
  • Text is normalized and cleaned internally

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

table2llm-0.2.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

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

table2llm-0.2.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file table2llm-0.2.0.tar.gz.

File metadata

  • Download URL: table2llm-0.2.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for table2llm-0.2.0.tar.gz
Algorithm Hash digest
SHA256 74f307ff1d2e30ca7ec7958eeb96d38329e40f6ed6b7dcf0d7001d7b37327f4e
MD5 019f63dae4deb697166794a436ca0aa2
BLAKE2b-256 da0876f73b5f24bf412fa589108d6961440502a75770b7c4b391ebe7924dad63

See more details on using hashes here.

File details

Details for the file table2llm-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: table2llm-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for table2llm-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eec5468742bfd56528bb82c74091cd8236ca302217e347cd32e91f140c7f0115
MD5 22ff3cb9c0d9a85ba276ed446d8c9e60
BLAKE2b-256 e01ee1399684d73e3b5f6506773a5d6bcb55bd41971617ab628c857d0b496011

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