A basic document parsing and loading utility - Markdown/HTML Conversion
Overview
The docp-* project suite is designed as a comprehensive (doc)ument (p)arsing library. Built in CPython, it consolidates the capabilities of various lower-level libraries, offering a unified solution for parsing binary document structures.
The suite is extended by several sister projects, each providing unique functionality:
| Project | Description |
|---|---|
| docp-core | Centralized core objects, functionality and settings. |
| docp-parsers | Parse binary documents (e.g. PDF, PPTX, etc.) into Python objects. |
| docp-loaders | Load a parsed document's embeddings into a Chroma vector database, for RAG-enabled LLM use. |
| docp-docling | Convert a PDF into Markdown or HTML format via wrappers to the docling libraries and models. |
| docp-dbi | Interfaces to document databases such as ChromaDB, and Neo4j (coming soon). |
The Toolset (Converters)
As of this release, PDF conversion into the following types is supported:
- PDF --> Markdown
- PDF --> HTML
Quickstart
Installation
To install docp-docling, first activate your target virtual environment, then use pip:
pip install docp-docling
For older releases, visit PyPI or the GitHub Releases page.
Model Fetching
If your project must remain offline, you’ll need to download the docling language model locally. The pdfparser.PDFParser class requires this model to be accessible, so it must be pre-fetched and set up before use. This section outlines how to download and configure the model for offline functionality.
- Download the model:
docling-tools models download \
--output-dir /path/to/models/docling-project
-
Update
config.tomlindocp-core:- Update the
doclingkey in thepaths.modelstable to match the download path specified in the previous step.
- Update the
Enabling GPU Support
GPU support (CUDA) should be automatically detected by library internals. However, guidance for enabling GPU-support is available.
Example Usage
For convenience, here are a couple examples for how to convert a PDF into the supported formats.
Parse a PDF into Markdown format:
>>> from docp_docling import PDFParser
# Convert
>>> pdf = PDFParser(path='/path/to/file.pdf')
>>> pdf.to_markdown()
# Access the converted content
>>> pdf.content
# Render extracted text as HTML and preview in a browser.
>>> pdf.preview()
Parse a single page from a PDF into Markdown format, including images, and store to a file:
>>> from docp_docling import PDFParser
# Convert
>>> pdf = PDFParser(path='/path/to/file.pdf')
>>> pdf.to_markdown(page_no=1,
image_mode='embedded', # <-- Include images
to_file=True)
# Render extracted text as HTML and preview in a browser.
>>> pdf.preview()
Parse a single page from a PDF into HTML format, including images:
>>> from docp_docling import PDFParser
# Convert
>>> pdf = PDFParser(path='/path/to/file.pdf')
>>> pdf.to_html(page_no=1,
image_mode='embedded') # <-- Include images
# Render extracted text and preview in a browser.
>>> pdf.preview()
Using the Library
The documentation suite provides detailed explanations and usage examples for each importable module. For in-depth documentation, code examples, and source links, refer to the Library API page.
A search field is available in the left navigation bar to help you quickly locate specific modules or methods.
Troubleshooting
No troubleshooting guidance is available at this time.
For questions not covered here, or to report bugs, issues, or suggestions, please open an issue on GitHub.
Metadata
Release files for docp-docling 1.0.1
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 | Actions |
|---|---|---|---|---|
| docp_docling-1.0.1.tar.gz | 8.9 MB | Without provenance | Details for docp_docling-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| docp_docling-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for docp_docling-1.0.1-py3-none-any.whl |
Total release size: 8.9 MB
Release files / docp_docling-1.0.1.tar.gz
| Download URL | docp_docling-1.0.1.tar.gz |
|---|---|
| Size | 8.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1d21741e0cf81ad17448e9e7ec3d4913d4f5e07ab79f9f887e22b8f1d3ccb153
|
|
BLAKE2b-256 checksum How to use checksums |
b798bcded3ab22fd0e3e874b25671b6ddbeb59f6fe99b023f38b322b73dd9081
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.7
|
Release files / docp_docling-1.0.1-py3-none-any.whl
| Download URL | docp_docling-1.0.1-py3-none-any.whl |
|---|---|
| Size | 22.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
084d4323e5c26ff91f175f1de1630b765858147577f388c78ef765dc69540928
|
|
BLAKE2b-256 checksum How to use checksums |
14cb3ded77d9a1c7bd34ce5b6c11923b27fd57fbd5d6a868f73e27f0b2603524
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.7
|
Security for docp-docling 1.0.1
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.