doc2mark

Getting started

  • Installation
  • Quickstart
  • A minimal RAG pipeline

User guide

  • Loading documents
  • Supported formats
  • The result: ProcessedDocument
  • PDF text structure
  • Tables
  • Images
  • OCR
  • When pages and pictures are OCR’d
  • Contextual OCR strategy
  • Caching
  • Chunking and token usage
  • Optional judge (TypeSafe / Jev)
  • Command line
  • Troubleshooting

Reference

  • API reference
    • UnifiedDocumentLoader
    • Convenience functions
    • Results, enums and exceptions
    • OCR
    • Structured OCR Schema
    • OCR cache
    • Chunking
    • Judge
  • Development
doc2mark
  • API reference
  • View page source

API reference

Signatures and member documentation on these pages are generated from the code (sphinx.ext.autodoc). Everything listed here is importable from doc2mark, except where a page names another module (doc2mark.ocr, doc2mark.ocr.schema, doc2mark.judge). The user guide explains how the pieces fit together; start with Quickstart.

  • UnifiedDocumentLoader
    • UnifiedDocumentLoader
  • Convenience functions
    • load()
    • document_to_markdown()
    • batch_convert_to_markdown()
    • batch_process_documents()
    • batch_process_files()
  • Results, enums and exceptions
    • ProcessedDocument
    • DocumentMetadata
    • Enums
    • Exceptions
  • OCR
    • The facade
    • Configuration
    • Results and enums
    • Providers
  • Structured OCR Schema
    • The verbatim / interpretation boundary
    • OCRPage — the top-level result
    • RawExtraction — verbatim page content
    • Table — a transcribed table
    • KeyValue — a label/value pair
    • Metric — a typed numeric assertion
    • The nested interpretation models
    • Interpretation — the model’s reading
    • A complete filled OCRPage (receipt)
    • Helpers
  • OCR cache
    • create_ocr_cache()
    • OCRCache
    • MemoryOCRCache
    • RedisOCRCache
    • NoOpOCRCache
    • CachedOCR
  • Chunking
    • chunk_content()
    • ChunkingConfig
    • Chunk
  • Judge
    • TypeSafeJudge
    • resolve_judge()
    • judge_hooks()
Previous Next

© Copyright 2026, Hao Liang Wen.

Built with Sphinx using a theme provided by Read the Docs.