{"library":"marker-pdf","title":"Marker PDF","description":"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.","language":"python","status":"active","last_verified":"Sun May 17","install":{"commands":["pip install marker-pdf"],"cli":{"name":"marker","version":""}},"imports":["from marker.convert import convert_single_pdf"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nfrom marker.convert import convert_single_pdf\n\n# Placeholder for your PDF file path. Replace with an actual path.\n# For a runnable example, ensure 'sample.pdf' exists or create a dummy.\npdf_path = os.environ.get('MARKER_PDF_PATH', 'sample.pdf')\n\n# Create a dummy PDF file if it doesn't exist for the example to be runnable\nif not os.path.exists(pdf_path):\n    try:\n        from pypdf import PdfWriter\n        writer = PdfWriter()\n        writer.add_blank_page(width=72, height=72)\n        with open(pdf_path, 'wb') as f:\n            writer.write(f)\n        print(f\"Created a dummy PDF at {pdf_path} for quickstart.\")\n    except ImportError:\n        print(\"To create a dummy PDF, install pypdf: `pip install pypdf`\")\n        print(f\"Please replace '{pdf_path}' with a path to a real PDF file.\")\n        pdf_path = None # Prevent execution if dummy couldn't be created\n\nif pdf_path and os.path.exists(pdf_path):\n    print(f\"Converting PDF: {pdf_path}\")\n    full_text, out_paths, _ = convert_single_pdf(\n        pdf_path,\n        recompile_pdf=True,\n        chunk_images=True\n        # Add other configuration as needed, e.g., processor_config\n    )\n\n    print(\"--- Markdown Output ---\")\n    print(full_text[:500]) # Print first 500 characters of markdown\n    print(f\"Extracted image paths: {out_paths}\")\nelse:\n    print(\"Skipping conversion: PDF path not valid or dummy PDF creation failed.\")","lang":"python","description":"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`.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-17","installed_version":"1.10.2","pypi_latest":"1.10.2","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":40,"avg_install_s":92,"avg_import_s":null,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"marker-pdf","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"marker-pdf","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":103.2,"import_time_s":null,"mem_mb":null,"disk_size":"5.3G"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"marker-pdf","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"marker-pdf","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":95.9,"import_time_s":null,"mem_mb":null,"disk_size":"5.3G"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"marker-pdf","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"marker-pdf","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":86.9,"import_time_s":null,"mem_mb":null,"disk_size":"5.3G"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"marker-pdf","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"marker-pdf","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":81.9,"import_time_s":null,"mem_mb":null,"disk_size":"5.3G"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"marker-pdf","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"marker-pdf","exit_code":1,"wheel_type":null,"failure_reason":"timeout","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null}]}}