DocParser 📄
DocParser is a powerful tool for LLM traning and other application, for examples: RAG, which support to parse multi type file, includes:
Feature 🎉
File types supported for parsing:
- Pdf: Use OCR to parse PDF documents and output text in markdown format. The parsing results can be used for LLM pretrain, RAG, etc.
- Html: Use jina to parse multi html pages and output text in markdown.
Install
From pip:
pip install docparser_feb
From repository:
pip install git+https://github.com/feb-co/DocParser.git
Or install it directly through the installation package:
git clone https://github.com/feb-co/DocParser.git
cd DocParser
pip install -e .
API/Functional
From CLI
You can run the following script to get the pdf parsing results:
export LOG_LEVEL="ERROR"
export DOC_PARSER_MODEL_DIR="xxx"
export DOC_PARSER_OPENAI_URL="xxx"
export DOC_PARSER_OPENAI_KEY="xxx"
export DOC_PARSER_OPENAI_MODEL="gpt-4-0125-preview"
export DOC_PARSER_OPENAI_RETRY="3"
docparser-pdf \
--inputs path/to/file.pdf or path/to/directory \
--output_dir output_directory \
--page_range '0:1' --mode 'figure latex' \
--rendering --use_llm --overwrite_result
The following is a description of the relevant parameters:
usage: docparser-pdf [-h] --inputs INPUTS --output_dir OUTPUT_DIR [--page_range PAGE_RANGE] [--mode {plain,figure placehold,figure latex}] [--rendering] [--use_llm]
options:
-h, --help show this help message and exit
--inputs INPUTS Directory where to store PDFs, or a file path to a single PDF
--output_dir OUTPUT_DIR
Directory where to store the output results (md/json/images).
--page_range PAGE_RANGE
The page range to parse the PDF, the format is 'start_page:end_page', that is, [start, end). Default: full.
--mode {plain,figure placehold,figure latex}
The mode for parsing the PDF, to extract only the plain text or the text plus images.
--rendering Is it necessary to render the recognition results of the input PDF to output the recognition range? Default: False.
--use_llm Do you need to use LLM to format the parsing results? If so, please specify the corresponding parameters through the environment variables: DOC_PARSER_OPENAI_URL, DOC_PARSER_OPENAI_KEY, DOC_PARSER_OPENAI_MODEL. Default: False.
--overwrite_result If the parsed target file already exists, should it be rewritten? Default: False.
From Python
Html
From CLI
You can run the following script to get the html parsing results:
docparser-html https://github.com/mem0ai/mem0
The following is a description of the relevant parameters:
From Python
Metadata
Release files for docparser-feb 0.1.5
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 | |
|---|---|---|---|---|
| docparser_feb-0.1.5.tar.gz | 424.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| docparser_feb-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 861.2 kB
Release files / docparser_feb-0.1.5.tar.gz
| Download URL | docparser_feb-0.1.5.tar.gz |
|---|---|
| Size | 424.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c4483878537bab79e9a77de2aa39536ad9bd48f16dd79f3073e4022211c15ed2
|
|
BLAKE2b-256 checksum How to use checksums |
95e8279f26a16735d0e12e45d2249f290819da4c586f347036da52ddf83efbef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Release files / docparser_feb-0.1.5-py3-none-any.whl
| Download URL | docparser_feb-0.1.5-py3-none-any.whl |
|---|---|
| Size | 437.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
30b5073ae113a410e93c36da8ae103e13d892f7188cb7a43361896c46c29e76e
|
|
BLAKE2b-256 checksum How to use checksums |
4353deb7b830b2cb3f5ee73d1d4a473c615270a6beeea8f05646fbf2834819e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Security for docparser-feb 0.1.5
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.