ParserStudio
Parsestudio is a powerful Python library for extracting and parsing content from PDF documents. It provides an intuitive interface for handling diverse tasks such as extracting text, tables, and images using different parsing backends.
Key Features
- Modular Design: Choose between multiple parser backends (Docling, PymuPDF, Llama Parse) to suit your needs.
- Multimodal Parsing: Extract text, tables, and images seamlessly.
- Extensible: Easily adjust parsing behavior with additional parameters.
Installation
Get started with Parsestudio by installing it via pip:
pip install parsestudio
Install the library from source by cloning the repository and running:
git clone https://github.com/chatclimate-ai/ParseStudio.git
cd ParseStudio
pip install .
Quick Start
1. Import and Initialize the Parser
from parsestudio.parse import PDFParser
# Initialize with the desired parser backend
parser = PDFParser(parser="docling") # Options: "docling", "pymupdf", "llama"
2. Parse a PDF File
outputs = parser.run("path/to/file.pdf", modalities=["text", "tables", "images"])
# Access text content
print(outputs[0].text)
# Output: text="This is the extracted text content from the PDF file."
# Access tables
for table in outputs[0].tables[0]:
print(table.markdown)
# Output: | Header 1 | Header 2 |
# |----------|----------|
# | Value 1 | Value 2 |
# Access images
for image in outputs[0].images[0]:
image.image.show()
metadata = image.metadata
print(metadata)
# Output: Metadata(page_number=1, bbox=[0, 0, 100, 100])
3. Supported Parsers
Choose from the following parsers based on your requirements:
- Docling: Advanced parser with multimodal capabilities.
- PyMuPDF: Lightweight and efficient.
- LlamaParse: AI-enhanced parser with advanced capabilities.
Each parser has its own strengths. Choose the one that best fits your use case.
Llama Setup
If you choose to use the LlamaPDFParser, you need to set up an API key. Follow these steps:
- Create a
.envFile: In the root directory of your project, create a file named.env. - Add Your API Key: Add the following line to the .env file, replacing your-api-key with your Llmap API key:
LLAMA_API_KEY=your-api-key
Contributing
We welcome contributions from the community! To contribute to Parsestudio, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them.
- Push your changes to your fork.
- Open a pull request.
- Our team will review your changes and merge them if they meet our guidelines.
Congratulations! You've contributed to Parsestudio.
Metadata
Release files for parsestudio 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| parsestudio-1.0.3.tar.gz | 13.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| parsestudio-1.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.4 kB
Release files / parsestudio-1.0.3.tar.gz
| Download URL | parsestudio-1.0.3.tar.gz |
|---|---|
| Size | 13.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e78bb3464eee3fe9924d0168c1e36ac3ed5da4767226a31dbf112ccf0dcb4a33
|
|
BLAKE2b-256 checksum How to use checksums |
d171d8b09afc01c219e892573b58214806af5518f7ceed2cb3768b92f8361b19
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Release files / parsestudio-1.0.3-py3-none-any.whl
| Download URL | parsestudio-1.0.3-py3-none-any.whl |
|---|---|
| Size | 12.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e566a58911383691baf6a55b002531beecabc4fe17d463314dcb1c2ad38a5c7c
|
|
BLAKE2b-256 checksum How to use checksums |
23f8abb05d6bf5b454cb5e3fb494289b3f9fe53b9a291aec11c1401a61e534d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Security for parsestudio 1.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.