A library for parsing various file formats to markdown format
Project description
ParsePro
ParsePro is a Python library that converts image/pdf into Markdown format using the Together API. It leverages large language models (Llama-3.2-11B-Vision) to extract content from image/pdf and structure it in a readable Markdown format .
Features
- Local image support.
- Remote image support.
- Single-page and multi-page PDF parsing.
- Local and remote PDF file parsing.
- Page-specific parsing, where users can specify or define a page range to parse.
Requirements
- Python 3.10+
- Together API key (required for authentication)
Installation
!apt-get install poppler-utils
pip install parsepro
Usage for Image
from parsepro import ImageToMarkdown
# Initialize the client with your Together API key
# Note: You can also set your API key as an environment variable named TOGETHER_API_KEY.
# import os
# os.environ['TOGETHER_API_KEY'] = ""
image_to_markdown = ImageToMarkdown()
# Convert an image to Markdown
markdown_content = image_to_markdown.convert_image_to_markdown(image_path = "path/to/your/image.jpg") # image_url = "" , prompt = ""
print(markdown_content)
Usage for pdf
from parsepro import PDFToMarkdown
# Initialize the client with your Together API key
# Note: You can also set your API key as an environment variable named TOGETHER_API_KEY.
# import os
# os.environ['TOGETHER_API_KEY'] = ""
pdf_to_markdown = PDFToMarkdown()
# Convert an image to Markdown
markdown_content = pdf_to_markdown.convert_pdf_to_markdown(pdf_path = "path/to/your/your_pdf.pdf") # pdf_url = "" and pages_to_parse = "2" or range "2-8"
print(markdown_content)
Define custom prompt
# Specify prompt for your usecase
# Convert an image to Markdown
markdown_content = pdf_to_markdown.convert_pdf_to_markdown(pdf_path = "path/to/your/your_pdf.pdf", prompt = "") # pdf_url = "" and pages_to_parse = "2" or range "2-8"
markdown_content = pdf_to_markdown.convert_pdf_to_markdown(pdf_path = "path/to/your/your_pdf.pdf",prompt = "")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
parsepro-1.0.1.tar.gz
(5.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file parsepro-1.0.1.tar.gz.
File metadata
- Download URL: parsepro-1.0.1.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9be7d4902893e89b98676c8daca53a9443860c9fcd4d76752c11105e8c7bfb3f
|
|
| MD5 |
cdee3efbddb086a61c7e81c531471498
|
|
| BLAKE2b-256 |
08dd91ebb31c05db3560f960260e0bdce5ec06a77ae4ada1bf7b94663dcde33f
|
File details
Details for the file parsepro-1.0.1-py3-none-any.whl.
File metadata
- Download URL: parsepro-1.0.1-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b20469fbbde2db6bcd722342f0d595ce542e0960a6bf462072056f05e355b78
|
|
| MD5 |
2304541e219ce69774d6907f881c8bdb
|
|
| BLAKE2b-256 |
9fd247d065fcfa11bc72d3a6888484ab8c94a7e6350439a9c58fc3984800495e
|