Metadata-Version: 2.1
Name: megaparse
Version: 0.0.24
Summary: Parse complex files (PDF,Docx,PPTX) for LLM consumption
License: Apache 2.0
Author: Quivr
Requires-Python: >=3.11,<3.13
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: langchain (>=0.2.11,<0.3.0)
Requires-Dist: langchain-community (>=0.2.10,<0.3.0)
Requires-Dist: langchain-core (>=0.2.23,<0.3.0)
Requires-Dist: langchain-openai (>=0.1.17,<0.2.0)
Requires-Dist: llama-parse (>=0.4.9,<0.5.0)
Requires-Dist: mammoth (>=1.8.0,<2.0.0)
Requires-Dist: pdf2docx (>=0.5.8,<0.6.0)
Requires-Dist: python-docx (>=1.1.2,<2.0.0)
Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
Requires-Dist: python-pptx (>=0.6.23,<0.7.0)
Requires-Dist: torch (==2.3.1) ; platform_machine != "x86_64" and sys_platform == "linux"
Requires-Dist: torch (==2.3.1) ; sys_platform == "darwin"
Requires-Dist: torch (==2.3.1+cpu) ; platform_machine == "x86_64" and sys_platform == "linux"
Requires-Dist: torch (==2.3.1+cpu) ; sys_platform == "win32"
Requires-Dist: torchvision (==0.18.1) ; platform_machine != "x86_64" and sys_platform == "linux"
Requires-Dist: torchvision (==0.18.1) ; sys_platform == "darwin"
Requires-Dist: torchvision (==0.18.1+cpu) ; platform_machine == "x86_64" and sys_platform == "linux"
Requires-Dist: torchvision (==0.18.1+cpu) ; sys_platform == "win32"
Requires-Dist: unstructured[pdf] (>=0.15.0,<0.16.0)
Description-Content-Type: text/markdown

# MegaParse - Your Mega Parser for every type of documents

<div align="center">
    <img src="https://raw.githubusercontent.com/QuivrHQ/MegaParse/main/logo.png" alt="Quivr-logo" width="30%"  style="border-radius: 50%; padding-bottom: 20px"/>
</div>

MegaParse is a powerful and versatile parser that can handle various types of documents with ease. Whether you're dealing with text, PDFs, Powerpoint presentations, Word documents MegaParse has got you covered. Focus on having no information loss during parsing.

## Key Features 🎯

- **Versatile Parser**: MegaParse is a powerful and versatile parser that can handle various types of documents with ease.
- **No Information Loss**: Focus on having no information loss during parsing.
- **Fast and Efficient**: Designed with speed and efficiency at its core.
- **Wide File Compatibility**: Supports Text, PDF, Powerpoint presentations, Excel, CSV, Word documents.
- **Open Source**: Freedom is beautiful, and so is MegaParse. Open source and free to use.

## Support

- Files: ✅ PDF ✅ Powerpoint ✅ Word
- Content: ✅ Tables ✅ TOC ✅ Headers ✅ Footers ✅ Images

### Example

https://github.com/QuivrHQ/MegaParse/assets/19614572/1b4cdb73-8dc2-44ef-b8b4-a7509bc8d4f3

## Installation

```bash
pip install megaparse
```

## Usage

1. Add your OpenAI API key to the .env file

2. Install poppler on your computer (images and PDFs)

3. Install tesseract on your computer (images and PDFs)

```python
from megaparse import MegaParse

megaparse = MegaParse(file_path="./test.pdf")
document = megaparse.load()
print(document.content)
megaparse.save_md(content, "./test.md")
```

### (Optional) Use LlamaParse for Improved Results

1. Create an account on [Llama Cloud](https://cloud.llamaindex.ai/) and get your API key.

2. Call Megaparse with the `llama_parse_api_key` parameter

```python
from megaparse import MegaParse

megaparse = MegaParse(file_path="./test.pdf", llama_parse_api_key="llx-your_api_key")
document = megaparse.load()
print(document.content)
```

## BenchMark

<!---BENCHMARK-->

| Parser                                   | Diff |
| ---------------------------------------- | ---- |
| LMM megaparse                            | 36   |
| Megaparse with LLamaParse and GPTCleaner | 74   |
| Megaparse with LLamaParse                | 97   |
| Unstructured Augmented Parse             | 99   |
| LLama Parse                              | 102  |
| **Megaparse**                            | 105  |

<!---END_BENCHMARK-->

_Lower is better_

## Next Steps

- [ ] Improve Table Parsing
- [ ] Improve Image Parsing and description
- [ ] Add TOC for Docx
- [ ] Add Hyperlinks for Docx
- [ ] Order Headers for Docx to Markdown



## Star History

[![Star History Chart](https://api.star-history.com/svg?repos=QuivrHQ/MegaParse&type=Date)](https://star-history.com/#QuivrHQ/MegaParse&Date)

