Skip to main content

pdfdeal

Package Testing on Python 3.8-3.13 on Win/Linux/macOS

Downloads GitHub License PyPI - Version GitHub Repo stars


📄Documentation


🗺️ ENGLISH | 简体中文

Handle PDF more easily and simply, utilizing Doc2X's powerful document conversion capabilities for retained format file conversion/RAG enhancement.

Introduction

Doc2X Support

Doc2X is a new universal document OCR tool that can convert images or PDF files into Markdown/LaTeX text with formulas and text formatting. It performs better than similar tools in most scenarios. pdfdeal provides abstract packaged classes to use Doc2X for requests.

Processing PDFs

Use various OCR or PDF recognition tools to identify images and add them to the original text. You can set the output format to use PDF, which will ensure that the recognized text retains the same page numbers as the original in the new PDF. It also offers various practical file processing tools.

After conversion and pre-processing of PDF using Doc2X, you can achieve better recognition rates when used with knowledge base applications such as graphrag, Dify, and FastGPT.

Markdown Document Processing Features

pdfdeal also provides a series of powerful tools to handle Markdown documents:

  • Convert HTML tables to Markdown format: Allows conversion of HTML formatted tables to Markdown format for easy use in Markdown documents.
  • Upload images to remote storage services: Supports uploading local or online images in Markdown documents to remote storage services to ensure image persistence and accessibility.
  • Convert online images to local images: Allows downloading and converting online images in Markdown documents to local images for offline use.
  • Document splitting and separator addition: Supports splitting Markdown documents by headings or adding separators within documents for better organization and management.

For detailed feature introduction and usage, please refer to the documentation link.

Cases

graphrag

See how to use it with graphrag, its not supported to recognize pdf, but you can use the CLI tool doc2x to convert it to a txt document for use.

Fastgpt/Dify or other RAG system

Or for knowledge base applications, you can use pdfdeal's built-in variety of enhancements to documents, such as uploading images to remote storage services, adding breaks by paragraph, etc. See Integration with RAG applications.

Documentation

For details, please refer to the documentation

Or check out the documentation repository pdfdeal-docs.

Quick Start

For details, please refer to the documentation

Installation

Install using pip:

pip install --upgrade pdfdeal

If you need document processing tools:

pip install --upgrade "pdfdeal[rag]"

Use the Doc2X PDF API to process all PDF files in a specified folder

from pdfdeal import Doc2X

client = Doc2X(apikey="Your API key",debug=True)
success, failed, flag = client.pdf2file(
    pdf_file="tests/pdf",
    output_path="./Output",
    output_format="docx",
)
print(success)
print(failed)
print(flag)

Use the Doc2X PDF API to process the specified PDF file and specify the name of the exported file

from pdfdeal import Doc2X

client = Doc2X(apikey="Your API key",debug=True)
success, failed, flag = client.pdf2file(
    pdf_file="tests/pdf/sample.pdf",
    output_path="./Output/test/single/pdf2file",
    output_names=["sample1.zip"],
    output_format="md_dollar",
)
print(success)
print(failed)
print(flag)

See the online documentation for details.

Metadata

Release files for pdfdeal 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pdfdeal 1.0.2
File Size Uploaded Provenance Actions
pdfdeal-1.0.2.tar.gz 118.6 kB With provenance Details for pdfdeal-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pdfdeal 1.0.2
File Interpreter ABI Platform Actions
pdfdeal-1.0.2-py3-none-any.whl Python 3 none any Details for pdfdeal-1.0.2-py3-none-any.whl

Total release size: 165.5 kB

Release files / pdfdeal-1.0.2.tar.gz

Download URL pdfdeal-1.0.2.tar.gz
Size 118.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e034dce303b228acf1ad2f9b44bb43a5eaff7353275918df8a159ffd2dca4675
BLAKE2b-256 checksum
How to use checksums
22003c962d2f560ac34bbfeef0c4db169d864988c186908404d317c3379fb850
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 22, 2024.

Transparency log

Release files / pdfdeal-1.0.2-py3-none-any.whl

Download URL pdfdeal-1.0.2-py3-none-any.whl
Size 46.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7252e5f4aec43e261e9dc446525284c6a1eb24586b16f0ca9b10c3e9c42312bc
BLAKE2b-256 checksum
How to use checksums
d05f0a02abfde4dd3208082d4627e5226babacb36f769643df9067c1f06fdb30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 22, 2024.

Transparency log

Security for pdfdeal 1.0.2

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pdfdeal-1.0.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 22, 2024.

Transparency log

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page