Skip to main content

LangChain data loaders based on Markdown by @untrueaxioms.

Project description

langchain-markitdown

Build License Last Commit Contributors

Markitdown LangChain Integration

This project provides document loaders that seamlessly integrate the Markitdown library with LangChain. Markitdown excels at converting various document types (DOCX, PPTX, XLSX, and more) into Markdown format. These loaders empower you to effortlessly load, process, and analyze these documents within your LangChain pipelines.

MarkItDown is a lightweight Python utility designed for converting diverse file formats into Markdown, optimized for use with Large Language Models (LLMs) and related text analysis workflows. It shares similarities with textract but distinguishes itself by prioritizing the preservation of crucial document structure and content as Markdown. This includes headings, lists, tables, links, and more. While the output is generally readable, its primary purpose is to be consumed by text analysis tools, rather than serving as a high-fidelity document conversion solution for human readers.

Explore the MarkItDown project on GitHub: https://github.com/microsoft/markitdown

Currently, MarkItDown supports:

  • PDF
  • PowerPoint
  • Word
  • Excel
  • Images (EXIF metadata and OCR)
  • Audio (EXIF metadata and speech transcription)
  • HTML
  • Text-based formats (CSV, JSON, XML)
  • ZIP files (iterates over contents)
  • YouTube URLs
  • EPUBs
  • ...and many more!

While this project borrows liberally from the amazing LangChain and Markitdown projects, it is not affiliated with either in any way.

Installation

Install the package using pip:

pip install langchain-markitdown

Usage

Specific Examples

DOCX

from langchain_markitdown import DocxLoader

loader = DocxLoader("path/to/your/document.docx")
documents = loader.load()

PPTX

from langchain_markitdown import PptxLoader

loader = PptxLoader("path/to/your/presentation.pptx")
documents = loader.load()

XLSX

from langchain_markitdown import XlsxLoader

loader = XlsxLoader("path/to/your/spreadsheet.xlsx")
documents = loader.load()

Metadata

The Document objects returned by the loaders include the following metadata:

  • source: The path to the source file.
  • file_name: The name of the source file.
  • file_size: The size of the source file in bytes.
  • conversion_success: A boolean indicating whether the conversion to Markdown was successful.
  • author: The author of the document (if available in the document metadata).
  • page_number: The page number (if splitting by page). Header information: When splitting by headers, the metadata will also include the header levels and values for each split.

Contributing

Contributions are welcome! Please fork the repository and submit a pull request with your changes.

License

MIT License

Trademarks

Markitdown, and so this project by extension, may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

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

langchain_markitdown-0.1.8.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

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

langchain_markitdown-0.1.8-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

Details for the file langchain_markitdown-0.1.8.tar.gz.

File metadata

  • Download URL: langchain_markitdown-0.1.8.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for langchain_markitdown-0.1.8.tar.gz
Algorithm Hash digest
SHA256 78c4fb550550cf84ae779f6267c2e17b2a9ff2dc80592543befa5da7e70baf2f
MD5 c4728b449150e2bf9d9d7a7a3310c245
BLAKE2b-256 c9538e9a0871c7ee86ee68fc7a1679b5ee26c19804de6a6094e7be0465150a55

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_markitdown-0.1.8.tar.gz:

Publisher: publish.yml on nsasto/langchain-markitdown

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file langchain_markitdown-0.1.8-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_markitdown-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 8149d9d65ac5c4c7e6a2ded3b0317703d8f8b89829a2c9d281293f709afb40c9
MD5 f966f2ef2327acaec2c602155df2196f
BLAKE2b-256 b78dac13f213c30acae1f6b5f03ae6cd2f6582b21f45b1e4a5435d69d7cdf656

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_markitdown-0.1.8-py3-none-any.whl:

Publisher: publish.yml on nsasto/langchain-markitdown

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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