Registry / ai-ml / marker-pdf

marker-pdf

JSON →
library1.10.2pypypiunverified

Marker PDF is a Python library that converts PDF documents to markdown with high speed and accuracy. Leveraging advanced OCR and layout analysis models, it aims to preserve the structure and content of the original document. As of version 1.10.2, it is actively developed with frequent minor releases focusing on model improvements, performance, and bug fixes.

pip install marker-pdf
INSTALL
IMPORT
SIG · MARKER-PDF
M
marker-pdf
ai-mlpythonv1.10.2
Install
94.3s avg
Import
—
Disk
5453MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v1.10.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
✓ 105.3s
py 3.11
✕ build_error
✓ 97.35s
py 3.12
✕ build_error
✓ 90.65s
py 3.13
✕ build_error
✓ 83.9s
py 3.9
✕ build_error
✕ timeout
5453MB installed
● package 5453MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

convert_single_pdf
✓ from marker.converters import convert_single_pdf
✗ from marker import convert_single_pdf

This quickstart demonstrates how to convert a single PDF file to markdown using `convert_single_pdf`. It includes placeholders for a PDF path and shows how to retrieve the markdown output and any extracted image paths. For a truly runnable example without a pre-existing PDF, it attempts to create a dummy PDF using `pypdf`.

import os from marker.convert import convert_single_pdf # Placeholder for your PDF file path. Replace with an actual path. # For a runnable example, ensure 'sample.pdf' exists or create a dummy. pdf_path = os.environ.get('MARKER_PDF_PATH', 'sample.pdf') # Create a dummy PDF file if it doesn't exist for the example to be runnable if not os.path.exists(pdf_path): try: from pypdf import PdfWriter writer = PdfWriter() writer.add_blank_page(width=72, height=72) with open(pdf_path, 'wb') as f: writer.write(f) print(f"Created a dummy PDF at {pdf_path} for quickstart.") except ImportError: print("To create a dummy PDF, install pypdf: `pip install pypdf`") print(f"Please replace '{pdf_path}' with a path to a real PDF file.") pdf_path = None # Prevent execution if dummy couldn't be created if pdf_path and os.path.exists(pdf_path): print(f"Converting PDF: {pdf_path}") full_text, out_paths, _ = convert_single_pdf( pdf_path, recompile_pdf=True, chunk_images=True # Add other configuration as needed, e.g., processor_config ) print("--- Markdown Output ---") print(full_text[:500]) # Print first 500 characters of markdown print(f"Extracted image paths: {out_paths}") else: print("Skipping conversion: PDF path not valid or dummy PDF creation failed.")
marker --version
Debug
Known issues
breakingThe `format_lines` parameter was removed from the `convert_single_pdf` API and CLI in `v1.8.3`. Users who relied on this parameter for fine-tuning output formatting will need to adjust their calls.
fix
Remove the `format_lines` parameter from your `convert_single_pdf` calls. Consider using `force_ocr` or other `processor_config` options if you were trying to control OCR behavior.
affects: >=1.8.3
gotchaMarker PDF uses deep learning models for OCR and layout analysis, which can be computationally intensive. Conversion can consume significant CPU and RAM, especially for large, complex, or image-heavy PDFs. Performance might also be impacted by model updates (e.g., 'block mode' in `v1.9.0` made it 'a bit slower').
fix
Ensure your environment has sufficient resources. For production, consider using GPU acceleration if available. For performance tuning, experiment with `processor_config` parameters, though changes might yield varied results.
affects: all
gotchaThe quality and exact formatting of the generated markdown can vary significantly based on the input PDF's structure, clarity, and the specific version of Marker PDF used. Frequent model updates (e.g., in `v1.10.0`, `v1.8.3`) aim to improve accuracy but can lead to subtle differences in output between versions.
fix
For critical applications requiring consistent output, pin your `marker-pdf` version. Review the output for complex PDFs and consider fine-tuning parameters via `processor_config`. For tables, `v1.10.0` introduced the `html_tables_in_markdown` option to render tables using HTML tags instead of markdown syntax, which can improve rendering in some cases.
affects: all
gotchaThe license for Marker PDF changed to an OpenRAIL-M-v1.0 license around `v1.8.5`. This is a significant change regarding the usage rights and commercial terms for the library and its models.
fix
Review the OpenRAIL-M-v1.0 license carefully to ensure compliance with your use case. Consult with legal counsel if you have questions regarding commercial or redistribution terms.
affects: >=1.8.5
Upgrade
Version history
1.10.2latest on PyPI · released Jan 31, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
52 hits · last 30 days
node
48
Resources
marker-pdf — pip install marker-pdf · libregistry