[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M72A15A6MJPSHT41FQAE3ZXR":3,"skill-same:01M72A15A6MJPSHT41FQAE3ZXR":70},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":50,"commitSha":51,"skillDirectory":5,"forksCount":52,"repositoryHtmlUrl":53,"repositoryHomepageUrl":6,"ownerHtmlUrl":54,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":55,"install":56,"resources":69},"01M72A15A6MJPSHT41FQAE3ZXR","doc-parser",null,">","claude-office-skills\u002Fskills","claude-office-skills","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F258027507?v=4","01M729XQC9FBRQ54AQZS0KY3ZK","AGI Lab","01M729XQCYW6WF9GY762P9RNQJ",572,"MIT","https:\u002F\u002Fgithub.com\u002Fclaude-office-skills\u002Fskills\u002Fblob\u002Fmain\u002Fdoc-parser\u002FSKILL.md",[],[],"2026-11-10 18:39:20",false,"---\n# ═══════════════════════════════════════════════════════════════════════════════\n# CLAUDE OFFICE SKILL - Enhanced Metadata v2.0\n# ═══════════════════════════════════════════════════════════════════════════════\n\n# Basic Information\nname: doc-parser\ndescription: \">\"\nversion: \"1.0\"\nauthor: claude-office-skills\nlicense: MIT\n\n# Categorization\ncategory: parsing\ntags:\n  - parsing\n  - extraction\n  - layout\n  - docling\ndepartment: All\n\n# AI Model Compatibility\nmodels:\n  recommended:\n    - claude-sonnet-4\n    - claude-opus-4\n  compatible:\n    - claude-3-5-sonnet\n    - gpt-4\n    - gpt-4o\n\n# MCP Tools Integration\nmcp:\n  server: office-mcp\n  tools:\n    - analyze_document_structure\n    - extract_text_from_pdf\n\n# Skill Capabilities\ncapabilities:\n  - document_parsing\n  - layout_analysis\n\n# Language Support\nlanguages:\n  - en\n  - zh\n---\n\n# Document Parser Skill\n\n## Overview\n\nThis skill enables advanced document parsing using **docling** - IBM's state-of-the-art document understanding library. Parse complex PDFs, Word documents, and images while preserving structure, extracting tables, figures, and handling multi-column layouts.\n\n## How to Use\n\n1. Provide the document to parse\n2. Specify what you want to extract (text, tables, figures, etc.)\n3. I'll parse it and return structured data\n\n**Example prompts:**\n- \"Parse this PDF and extract all tables\"\n- \"Convert this academic paper to structured markdown\"\n- \"Extract figures and captions from this document\"\n- \"Parse this report preserving the document structure\"\n\n## Domain Knowledge\n\n### docling Fundamentals\n\n```python\nfrom docling.document_converter import DocumentConverter\n\n# Initialize converter\nconverter = DocumentConverter()\n\n# Convert document\nresult = converter.convert(\"document.pdf\")\n\n# Access parsed content\ndoc = result.document\nprint(doc.export_to_markdown())\n```\n\n### Supported Formats\n\n| Format | Extension | Notes |\n|--------|-----------|-------|\n| PDF | .pdf | Native and scanned |\n| Word | .docx | Full structure preserved |\n| PowerPoint | .pptx | Slides as sections |\n| Images | .png, .jpg | OCR + layout analysis |\n| HTML | .html | Structure preserved |\n\n### Basic Usage\n\n```python\nfrom docling.document_converter import DocumentConverter\n\n# Create converter\nconverter = DocumentConverter()\n\n# Convert single document\nresult = converter.convert(\"report.pdf\")\n\n# Access document\ndoc = result.document\n\n# Export options\nmarkdown = doc.export_to_markdown()\ntext = doc.export_to_text()\njson_doc = doc.export_to_dict()\n```\n\n### Advanced Configuration\n\n```python\nfrom docling.document_converter import DocumentConverter\nfrom docling.datamodel.base_models import InputFormat\nfrom docling.datamodel.pipeline_options import PdfPipelineOptions\n\n# Configure pipeline\npipeline_options = PdfPipelineOptions()\npipeline_options.do_ocr = True\npipeline_options.do_table_structure = True\npipeline_options.table_structure_options.do_cell_matching = True\n\n# Create converter with options\nconverter = DocumentConverter(\n    allowed_formats=[InputFormat.PDF, InputFormat.DOCX],\n    pdf_backend_options=pipeline_options\n)\n\nresult = converter.convert(\"document.pdf\")\n```\n\n### Document Structure\n\n```python\n# Document hierarchy\ndoc = result.document\n\n# Access metadata\nprint(doc.name)\nprint(doc.origin)\n\n# Iterate through content\nfor element in doc.iterate_items():\n    print(f\"Type: {element.type}\")\n    print(f\"Text: {element.text}\")\n    \n    if element.type == \"table\":\n        print(f\"Rows: {len(element.data.table_cells)}\")\n```\n\n### Extracting Tables\n\n```python\nfrom docling.document_converter import DocumentConverter\nimport pandas as pd\n\ndef extract_tables(doc_path):\n    \"\"\"Extract all tables from document.\"\"\"\n    converter = DocumentConverter()\n    result = converter.convert(doc_path)\n    doc = result.document\n    \n    tables = []\n    \n    for element in doc.iterate_items():\n        if element.type == \"table\":\n            # Get table data\n            table_data = element.export_to_dataframe()\n            tables.append({\n                'page': element.prov[0].page_no if element.prov else None,\n                'dataframe': table_data\n            })\n    \n    return tables\n\n# Usage\ntables = extract_tables(\"report.pdf\")\nfor i, table in enumerate(tables):\n    print(f\"Table {i+1} on page {table['page']}:\")\n    print(table['dataframe'])\n```\n\n### Extracting Figures\n\n```python\ndef extract_figures(doc_path, output_dir):\n    \"\"\"Extract figures with captions.\"\"\"\n    import os\n    \n    converter = DocumentConverter()\n    result = converter.convert(doc_path)\n    doc = result.document\n    \n    figures = []\n    os.makedirs(output_dir, exist_ok=True)\n    \n    for element in doc.iterate_items():\n        if element.type == \"picture\":\n            figure_info = {\n                'caption': element.caption if hasattr(element, 'caption') else None,\n                'page': element.prov[0].page_no if element.prov else None,\n            }\n            \n            # Save image if available\n            if hasattr(element, 'image'):\n                img_path = os.path.join(output_dir, f\"figure_{len(figures)+1}.png\")\n                element.image.save(img_path)\n                figure_info['path'] = img_path\n            \n            figures.append(figure_info)\n    \n    return figures\n```\n\n### Handling Multi-column Layouts\n\n```python\nfrom docling.document_converter import DocumentConverter\n\ndef parse_multicolumn(doc_path):\n    \"\"\"Parse document with multi-column layout.\"\"\"\n    \n    converter = DocumentConverter()\n    result = converter.convert(doc_path)\n    doc = result.document\n    \n    # docling automatically handles column detection\n    # Text is returned in reading order\n    \n    structured_content = []\n    \n    for element in doc.iterate_items():\n        content_item = {\n            'type': element.type,\n            'text': element.text if hasattr(element, 'text') else None,\n            'level': element.level if hasattr(element, 'level') else None,\n        }\n        \n        # Add bounding box if available\n        if element.prov:\n            content_item['bbox'] = element.prov[0].bbox\n            content_item['page'] = element.prov[0].page_no\n        \n        structured_content.append(content_item)\n    \n    return structured_content\n```\n\n### Export Formats\n\n```python\nfrom docling.document_converter import DocumentConverter\n\nconverter = DocumentConverter()\nresult = converter.convert(\"document.pdf\")\ndoc = result.document\n\n# Markdown export\nmarkdown = doc.export_to_markdown()\nwith open(\"output.md\", \"w\") as f:\n    f.write(markdown)\n\n# Plain text\ntext = doc.export_to_text()\n\n# JSON\u002Fdict format\njson_doc = doc.export_to_dict()\n\n# HTML format (if supported)\n# html = doc.export_to_html()\n```\n\n### Batch Processing\n\n```python\nfrom docling.document_converter import DocumentConverter\nfrom pathlib import Path\nfrom concurrent.futures import ThreadPoolExecutor\n\ndef batch_parse(input_dir, output_dir, max_workers=4):\n    \"\"\"Parse multiple documents in parallel.\"\"\"\n    \n    input_path = Path(input_dir)\n    output_path = Path(output_dir)\n    output_path.mkdir(exist_ok=True)\n    \n    converter = DocumentConverter()\n    \n    def process_single(doc_path):\n        try:\n            result = converter.convert(str(doc_path))\n            md = result.document.export_to_markdown()\n            \n            out_file = output_path \u002F f\"{doc_path.stem}.md\"\n            with open(out_file, 'w') as f:\n                f.write(md)\n            \n            return {'file': str(doc_path), 'status': 'success'}\n        except Exception as e:\n            return {'file': str(doc_path), 'status': 'error', 'error': str(e)}\n    \n    docs = list(input_path.glob('*.pdf')) + list(input_path.glob('*.docx'))\n    \n    with ThreadPoolExecutor(max_workers=max_workers) as executor:\n        results = list(executor.map(process_single, docs))\n    \n    return results\n```\n\n## Best Practices\n\n1. **Use Appropriate Pipeline**: Configure for your document type\n2. **Handle Large Documents**: Process in chunks if needed\n3. **Verify Table Extraction**: Complex tables may need review\n4. **Check OCR Quality**: Enable OCR for scanned documents\n5. **Cache Results**: Store parsed documents for reuse\n\n## Common Patterns\n\n### Academic Paper Parser\n```python\ndef parse_academic_paper(pdf_path):\n    \"\"\"Parse academic paper structure.\"\"\"\n    \n    converter = DocumentConverter()\n    result = converter.convert(pdf_path)\n    doc = result.document\n    \n    paper = {\n        'title': None,\n        'abstract': None,\n        'sections': [],\n        'references': [],\n        'tables': [],\n        'figures': []\n    }\n    \n    current_section = None\n    \n    for element in doc.iterate_items():\n        text = element.text if hasattr(element, 'text') else ''\n        \n        if element.type == 'title':\n            paper['title'] = text\n        \n        elif element.type == 'heading':\n            if 'abstract' in text.lower():\n                current_section = 'abstract'\n            elif 'reference' in text.lower():\n                current_section = 'references'\n            else:\n                paper['sections'].append({\n                    'title': text,\n                    'content': ''\n                })\n                current_section = 'section'\n        \n        elif element.type == 'paragraph':\n            if current_section == 'abstract':\n                paper['abstract'] = text\n            elif current_section == 'section' and paper['sections']:\n                paper['sections'][-1]['content'] += text + '\\n'\n        \n        elif element.type == 'table':\n            paper['tables'].append({\n                'caption': element.caption if hasattr(element, 'caption') else None,\n                'data': element.export_to_dataframe() if hasattr(element, 'export_to_dataframe') else None\n            })\n    \n    return paper\n```\n\n### Report to Structured Data\n```python\ndef parse_business_report(doc_path):\n    \"\"\"Parse business report into structured format.\"\"\"\n    \n    converter = DocumentConverter()\n    result = converter.convert(doc_path)\n    doc = result.document\n    \n    report = {\n        'metadata': {\n            'title': None,\n            'date': None,\n            'author': None\n        },\n        'executive_summary': None,\n        'sections': [],\n        'key_metrics': [],\n        'recommendations': []\n    }\n    \n    # Parse document structure\n    for element in doc.iterate_items():\n        # Implement parsing logic based on document structure\n        pass\n    \n    return report\n```\n\n## Examples\n\n### Example 1: Parse Financial Report\n```python\nfrom docling.document_converter import DocumentConverter\n\ndef parse_financial_report(pdf_path):\n    \"\"\"Extract structured data from financial report.\"\"\"\n    \n    converter = DocumentConverter()\n    result = converter.convert(pdf_path)\n    doc = result.document\n    \n    financial_data = {\n        'income_statement': None,\n        'balance_sheet': None,\n        'cash_flow': None,\n        'notes': []\n    }\n    \n    # Extract tables\n    tables = []\n    for element in doc.iterate_items():\n        if element.type == 'table':\n            table_df = element.export_to_dataframe()\n            \n            # Identify table type\n            if 'revenue' in str(table_df).lower() or 'income' in str(table_df).lower():\n                financial_data['income_statement'] = table_df\n            elif 'asset' in str(table_df).lower() or 'liabilities' in str(table_df).lower():\n                financial_data['balance_sheet'] = table_df\n            elif 'cash' in str(table_df).lower():\n                financial_data['cash_flow'] = table_df\n            else:\n                tables.append(table_df)\n    \n    # Extract markdown for notes\n    financial_data['markdown'] = doc.export_to_markdown()\n    \n    return financial_data\n\nreport = parse_financial_report('annual_report.pdf')\nprint(\"Income Statement:\")\nprint(report['income_statement'])\n```\n\n### Example 2: Technical Documentation Parser\n```python\nfrom docling.document_converter import DocumentConverter\n\ndef parse_technical_docs(doc_path):\n    \"\"\"Parse technical documentation.\"\"\"\n    \n    converter = DocumentConverter()\n    result = converter.convert(doc_path)\n    doc = result.document\n    \n    documentation = {\n        'title': None,\n        'version': None,\n        'sections': [],\n        'code_blocks': [],\n        'diagrams': []\n    }\n    \n    current_section = None\n    \n    for element in doc.iterate_items():\n        if element.type == 'title':\n            documentation['title'] = element.text\n        \n        elif element.type == 'heading':\n            current_section = {\n                'title': element.text,\n                'level': element.level if hasattr(element, 'level') else 1,\n                'content': []\n            }\n            documentation['sections'].append(current_section)\n        \n        elif element.type == 'code':\n            if current_section:\n                current_section['content'].append({\n                    'type': 'code',\n                    'content': element.text\n                })\n            documentation['code_blocks'].append(element.text)\n        \n        elif element.type == 'picture':\n            documentation['diagrams'].append({\n                'page': element.prov[0].page_no if element.prov else None,\n                'caption': element.caption if hasattr(element, 'caption') else None\n            })\n    \n    return documentation\n\ndocs = parse_technical_docs('api_documentation.pdf')\nprint(f\"Title: {docs['title']}\")\nprint(f\"Sections: {len(docs['sections'])}\")\n```\n\n### Example 3: Contract Analysis\n```python\nfrom docling.document_converter import DocumentConverter\n\ndef analyze_contract(pdf_path):\n    \"\"\"Parse contract document for key clauses.\"\"\"\n    \n    converter = DocumentConverter()\n    result = converter.convert(pdf_path)\n    doc = result.document\n    \n    contract = {\n        'parties': [],\n        'clauses': [],\n        'dates': [],\n        'amounts': [],\n        'full_text': doc.export_to_text()\n    }\n    \n    import re\n    \n    # Extract dates\n    date_pattern = r'\\b\\d{1,2}[\u002F-]\\d{1,2}[\u002F-]\\d{2,4}\\b|\\b(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[a-z]* \\d{1,2},? \\d{4}\\b'\n    contract['dates'] = re.findall(date_pattern, contract['full_text'], re.IGNORECASE)\n    \n    # Extract monetary amounts\n    amount_pattern = r'\\$[\\d,]+(?:\\.\\d{2})?|\\b\\d+(?:,\\d{3})*(?:\\.\\d{2})?\\s*(?:USD|dollars)\\b'\n    contract['amounts'] = re.findall(amount_pattern, contract['full_text'], re.IGNORECASE)\n    \n    # Parse sections as clauses\n    for element in doc.iterate_items():\n        if element.type == 'heading':\n            contract['clauses'].append({\n                'title': element.text,\n                'content': ''\n            })\n        elif element.type == 'paragraph' and contract['clauses']:\n            contract['clauses'][-1]['content'] += element.text + '\\n'\n    \n    return contract\n\ncontract_data = analyze_contract('agreement.pdf')\nprint(f\"Key dates: {contract_data['dates']}\")\nprint(f\"Amounts: {contract_data['amounts']}\")\n```\n\n## Limitations\n\n- Very large documents may require chunking\n- Handwritten content needs OCR preprocessing\n- Complex nested tables may need manual review\n- Some PDF types (encrypted) not supported\n- GPU recommended for best performance\n\n## Installation\n\n```bash\npip install docling\n\n# For full functionality\npip install docling[all]\n\n# For OCR support\npip install docling[ocr]\n```\n\n## Resources\n\n- [docling GitHub](https:\u002F\u002Fgithub.com\u002FDS4SD\u002Fdocling)\n- [Documentation](https:\u002F\u002Fds4sd.github.io\u002Fdocling\u002F)\n- [IBM Research Blog](https:\u002F\u002Fresearch.ibm.com\u002F)\n","# Document Parser Skill\n\n## Overview\n\nThis skill enables advanced document parsing using **docling** - IBM's state-of-the-art document understanding library. Parse complex PDFs, Word documents, and images while preserving structure, extracting tables, figures, and handling multi-column layouts.\n\n## How to Use\n\n1. Provide the document to parse\n2. Specify what you want to extract (text, tables, figures, etc.)\n3. I'll parse it and return structured data\n\n**Example prompts:**\n- \"Parse this PDF and extract all tables\"\n- \"Convert this academic paper to structured markdown\"\n- \"Extract figures and captions from this document\"\n- \"Parse this report preserving the document structure\"\n\n## Domain Knowledge\n\n### docling Fundamentals\n\n```python\nfrom docling.document_converter import DocumentConverter\n\n# Initialize converter\nconverter = DocumentConverter()\n\n# Convert document\nresult = converter.convert(\"document.pdf\")\n\n# Access parsed content\ndoc = result.document\nprint(doc.export_to_markdown())\n```\n\n### Supported Formats\n\n| Format | Extension | Notes |\n|--------|-----------|-------|\n| PDF | .pdf | Native and scanned |\n| Word | .docx | Full structure preserved |\n| PowerPoint | .pptx | Slides as sections |\n| Images | .png, .jpg | OCR + layout analysis |\n| HTML | .html | Structure preserved |\n\n### Basic Usage\n\n```python\nfrom docling.document_converter import DocumentConverter\n\n# Create converter\nconverter = DocumentConverter()\n\n# Convert single document\nresult = converter.convert(\"report.pdf\")\n\n# Access document\ndoc = result.document\n\n# Export options\nmarkdown = doc.export_to_markdown()\ntext = doc.export_to_text()\njson_doc = doc.export_to_dict()\n```\n\n### Advanced Configuration\n\n```python\nfrom docling.document_converter import DocumentConverter\nfrom docling.datamodel.base_models import InputFormat\nfrom docling.datamodel.pipeline_options import PdfPipelineOptions\n\n# Configure pipeline\npipeline_options = PdfPipelineOptions()\npipeline_options.do_ocr = True\npipeline_options.do_table_structure = True\npipeline_options.table_structure_options.do_cell_matching = True\n\n# Create converter with options\nconverter = DocumentConverter(\n    allowed_formats=[InputFormat.PDF, InputFormat.DOCX],\n    pdf_backend_options=pipeline_options\n)\n\nresult = converter.convert(\"document.pdf\")\n```\n\n### Document Structure\n\n```python\n# Document hierarchy\ndoc = result.document\n\n# Access metadata\nprint(doc.name)\nprint(doc.origin)\n\n# Iterate through content\nfor element in doc.iterate_items():\n    print(f\"Type: {element.type}\")\n    print(f\"Text: {element.text}\")\n    \n    if element.type == \"table\":\n        print(f\"Rows: {len(element.data.table_cells)}\")\n```\n\n### Extracting Tables\n\n```python\nfrom docling.document_converter import DocumentConverter\nimport pandas as pd\n\ndef extract_tables(doc_path):\n    \"\"\"Extract all tables from document.\"\"\"\n    converter = DocumentConverter()\n    result = converter.convert(doc_path)\n    doc = result.document\n    \n    tables = []\n    \n    for element in doc.iterate_items():\n        if element.type == \"table\":\n            # Get table data\n            table_data = element.export_to_dataframe()\n            tables.append({\n                'page': element.prov[0].page_no if element.prov else None,\n                'dataframe': table_data\n            })\n    \n    return tables\n\n# Usage\ntables = extract_tables(\"report.pdf\")\nfor i, table in enumerate(tables):\n    print(f\"Table {i+1} on page {table['page']}:\")\n    print(table['dataframe'])\n```\n\n### Extracting Figures\n\n```python\ndef extract_figures(doc_path, output_dir):\n    \"\"\"Extract figures with captions.\"\"\"\n    import os\n    \n    converter = DocumentConverter()\n    result = converter.convert(doc_path)\n    doc = result.document\n    \n    figures = []\n    os.makedirs(output_dir, exist_ok=True)\n    \n    for element in doc.iterate_items():\n        if element.type == \"picture\":\n            figure_info = {\n                'caption': element.caption if hasattr(element, 'caption') else None,\n                'page': element.prov[0].page_no if element.prov else None,\n            }\n            \n            # Save image if available\n            if hasattr(element, 'image'):\n                img_path = os.path.join(output_dir, f\"figure_{len(figures)+1}.png\")\n                element.image.save(img_path)\n                figure_info['path'] = img_path\n            \n            figures.append(figure_info)\n    \n    return figures\n```\n\n### Handling Multi-column Layouts\n\n```python\nfrom docling.document_converter import DocumentConverter\n\ndef parse_multicolumn(doc_path):\n    \"\"\"Parse document with multi-column layout.\"\"\"\n    \n    converter = DocumentConverter()\n    result = converter.convert(doc_path)\n    doc = result.document\n    \n    # docling automatically handles column detection\n    # Text is returned in reading order\n    \n    structured_content = []\n    \n    for element in doc.iterate_items():\n        content_item = {\n            'type': element.type,\n            'text': element.text if hasattr(element, 'text') else None,\n            'level': element.level if hasattr(element, 'level') else None,\n        }\n        \n        # Add bounding box if available\n        if element.prov:\n            content_item['bbox'] = element.prov[0].bbox\n            content_item['page'] = element.prov[0].page_no\n        \n        structured_content.append(content_item)\n    \n    return structured_content\n```\n\n### Export Formats\n\n```python\nfrom docling.document_converter import DocumentConverter\n\nconverter = DocumentConverter()\nresult = converter.convert(\"document.pdf\")\ndoc = result.document\n\n# Markdown export\nmarkdown = doc.export_to_markdown()\nwith open(\"output.md\", \"w\") as f:\n    f.write(markdown)\n\n# Plain text\ntext = doc.export_to_text()\n\n# JSON\u002Fdict format\njson_doc = doc.export_to_dict()\n\n# HTML format (if supported)\n# html = doc.export_to_html()\n```\n\n### Batch Processing\n\n```python\nfrom docling.document_converter import DocumentConverter\nfrom pathlib import Path\nfrom concurrent.futures import ThreadPoolExecutor\n\ndef batch_parse(input_dir, output_dir, max_workers=4):\n    \"\"\"Parse multiple documents in parallel.\"\"\"\n    \n    input_path = Path(input_dir)\n    output_path = Path(output_dir)\n    output_path.mkdir(exist_ok=True)\n    \n    converter = DocumentConverter()\n    \n    def process_single(doc_path):\n        try:\n            result = converter.convert(str(doc_path))\n            md = result.document.export_to_markdown()\n            \n            out_file = output_path \u002F f\"{doc_path.stem}.md\"\n            with open(out_file, 'w') as f:\n                f.write(md)\n            \n            return {'file': str(doc_path), 'status': 'success'}\n        except Exception as e:\n            return {'file': str(doc_path), 'status': 'error', 'error': str(e)}\n    \n    docs = list(input_path.glob('*.pdf')) + list(input_path.glob('*.docx'))\n    \n    with ThreadPoolExecutor(max_workers=max_workers) as executor:\n        results = list(executor.map(process_single, docs))\n    \n    return results\n```\n\n## Best Practices\n\n1. **Use Appropriate Pipeline**: Configure for your document type\n2. **Handle Large Documents**: Process in chunks if needed\n3. **Verify Table Extraction**: Complex tables may need review\n4. **Check OCR Quality**: Enable OCR for scanned documents\n5. **Cache Results**: Store parsed documents for reuse\n\n## Common Patterns\n\n### Academic Paper Parser\n```python\ndef parse_academic_paper(pdf_path):\n    \"\"\"Parse academic paper structure.\"\"\"\n    \n    converter = DocumentConverter()\n    result = converter.convert(pdf_path)\n    doc = result.document\n    \n    paper = {\n        'title': None,\n        'abstract': None,\n        'sections': [],\n        'references': [],\n        'tables': [],\n        'figures': []\n    }\n    \n    current_section = None\n    \n    for element in doc.iterate_items():\n        text = element.text if hasattr(element, 'text') else ''\n        \n        if element.type == 'title':\n            paper['title'] = text\n        \n        elif element.type == 'heading':\n            if 'abstract' in text.lower():\n                current_section = 'abstract'\n            elif 'reference' in text.lower():\n                current_section = 'references'\n            else:\n                paper['sections'].append({\n                    'title': text,\n                    'content': ''\n                })\n                current_section = 'section'\n        \n        elif element.type == 'paragraph':\n            if current_section == 'abstract':\n                paper['abstract'] = text\n            elif current_section == 'section' and paper['sections']:\n                paper['sections'][-1]['content'] += text + '\\n'\n        \n        elif element.type == 'table':\n            paper['tables'].append({\n                'caption': element.caption if hasattr(element, 'caption') else None,\n                'data': element.export_to_dataframe() if hasattr(element, 'export_to_dataframe') else None\n            })\n    \n    return paper\n```\n\n### Report to Structured Data\n```python\ndef parse_business_report(doc_path):\n    \"\"\"Parse business report into structured format.\"\"\"\n    \n    converter = DocumentConverter()\n    result = converter.convert(doc_path)\n    doc = result.document\n    \n    report = {\n        'metadata': {\n            'title': None,\n            'date': None,\n            'author': None\n        },\n        'executive_summary': None,\n        'sections': [],\n        'key_metrics': [],\n        'recommendations': []\n    }\n    \n    # Parse document structure\n    for element in doc.iterate_items():\n        # Implement parsing logic based on document structure\n        pass\n    \n    return report\n```\n\n## Examples\n\n### Example 1: Parse Financial Report\n```python\nfrom docling.document_converter import DocumentConverter\n\ndef parse_financial_report(pdf_path):\n    \"\"\"Extract structured data from financial report.\"\"\"\n    \n    converter = DocumentConverter()\n    result = converter.convert(pdf_path)\n    doc = result.document\n    \n    financial_data = {\n        'income_statement': None,\n        'balance_sheet': None,\n        'cash_flow': None,\n        'notes': []\n    }\n    \n    # Extract tables\n    tables = []\n    for element in doc.iterate_items():\n        if element.type == 'table':\n            table_df = element.export_to_dataframe()\n            \n            # Identify table type\n            if 'revenue' in str(table_df).lower() or 'income' in str(table_df).lower():\n                financial_data['income_statement'] = table_df\n            elif 'asset' in str(table_df).lower() or 'liabilities' in str(table_df).lower():\n                financial_data['balance_sheet'] = table_df\n            elif 'cash' in str(table_df).lower():\n                financial_data['cash_flow'] = table_df\n            else:\n                tables.append(table_df)\n    \n    # Extract markdown for notes\n    financial_data['markdown'] = doc.export_to_markdown()\n    \n    return financial_data\n\nreport = parse_financial_report('annual_report.pdf')\nprint(\"Income Statement:\")\nprint(report['income_statement'])\n```\n\n### Example 2: Technical Documentation Parser\n```python\nfrom docling.document_converter import DocumentConverter\n\ndef parse_technical_docs(doc_path):\n    \"\"\"Parse technical documentation.\"\"\"\n    \n    converter = DocumentConverter()\n    result = converter.convert(doc_path)\n    doc = result.document\n    \n    documentation = {\n        'title': None,\n        'version': None,\n        'sections': [],\n        'code_blocks': [],\n        'diagrams': []\n    }\n    \n    current_section = None\n    \n    for element in doc.iterate_items():\n        if element.type == 'title':\n            documentation['title'] = element.text\n        \n        elif element.type == 'heading':\n            current_section = {\n                'title': element.text,\n                'level': element.level if hasattr(element, 'level') else 1,\n                'content': []\n            }\n            documentation['sections'].append(current_section)\n        \n        elif element.type == 'code':\n            if current_section:\n                current_section['content'].append({\n                    'type': 'code',\n                    'content': element.text\n                })\n            documentation['code_blocks'].append(element.text)\n        \n        elif element.type == 'picture':\n            documentation['diagrams'].append({\n                'page': element.prov[0].page_no if element.prov else None,\n                'caption': element.caption if hasattr(element, 'caption') else None\n            })\n    \n    return documentation\n\ndocs = parse_technical_docs('api_documentation.pdf')\nprint(f\"Title: {docs['title']}\")\nprint(f\"Sections: {len(docs['sections'])}\")\n```\n\n### Example 3: Contract Analysis\n```python\nfrom docling.document_converter import DocumentConverter\n\ndef analyze_contract(pdf_path):\n    \"\"\"Parse contract document for key clauses.\"\"\"\n    \n    converter = DocumentConverter()\n    result = converter.convert(pdf_path)\n    doc = result.document\n    \n    contract = {\n        'parties': [],\n        'clauses': [],\n        'dates': [],\n        'amounts': [],\n        'full_text': doc.export_to_text()\n    }\n    \n    import re\n    \n    # Extract dates\n    date_pattern = r'\\b\\d{1,2}[\u002F-]\\d{1,2}[\u002F-]\\d{2,4}\\b|\\b(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[a-z]* \\d{1,2},? \\d{4}\\b'\n    contract['dates'] = re.findall(date_pattern, contract['full_text'], re.IGNORECASE)\n    \n    # Extract monetary amounts\n    amount_pattern = r'\\$[\\d,]+(?:\\.\\d{2})?|\\b\\d+(?:,\\d{3})*(?:\\.\\d{2})?\\s*(?:USD|dollars)\\b'\n    contract['amounts'] = re.findall(amount_pattern, contract['full_text'], re.IGNORECASE)\n    \n    # Parse sections as clauses\n    for element in doc.iterate_items():\n        if element.type == 'heading':\n            contract['clauses'].append({\n                'title': element.text,\n                'content': ''\n            })\n        elif element.type == 'paragraph' and contract['clauses']:\n            contract['clauses'][-1]['content'] += element.text + '\\n'\n    \n    return contract\n\ncontract_data = analyze_contract('agreement.pdf')\nprint(f\"Key dates: {contract_data['dates']}\")\nprint(f\"Amounts: {contract_data['amounts']}\")\n```\n\n## Limitations\n\n- Very large documents may require chunking\n- Handwritten content needs OCR preprocessing\n- Complex nested tables may need manual review\n- Some PDF types (encrypted) not supported\n- GPU recommended for best performance\n\n## Installation\n\n```bash\npip install docling\n\n# For full functionality\npip install docling[all]\n\n# For OCR support\npip install docling[ocr]\n```\n\n## Resources\n\n- [docling GitHub](https:\u002F\u002Fgithub.com\u002FDS4SD\u002Fdocling)\n- [Documentation](https:\u002F\u002Fds4sd.github.io\u002Fdocling\u002F)\n- [IBM Research Blog](https:\u002F\u002Fresearch.ibm.com\u002F)\n",{"mcp":24,"name":5,"tags":29,"author":9,"models":34,"license":15,"version":42,"category":30,"languages":43,"department":46,"description":7,"capabilities":47},{"tools":25,"server":28},[26,27],"analyze_document_structure","extract_text_from_pdf","office-mcp",[30,31,32,33],"parsing","extraction","layout","docling",{"compatible":35,"recommended":39},[36,37,38],"claude-3-5-sonnet","gpt-4","gpt-4o",[40,41],"claude-sonnet-4","claude-opus-4","1.0",[44,45],"en","zh","All",[48,49],"document_parsing","layout_analysis","main","9c4c7d5cd2813a8936bf2c9fdb174ea883b85a11",101,"https:\u002F\u002Fgithub.com\u002Fclaude-office-skills\u002Fskills","https:\u002F\u002Fgithub.com\u002Fclaude-office-skills","2026-01-31 22:03:56",{"source":8,"skillName":5,"commands":57,"prompt":67,"zipAvailable":68},[58,61,64],{"tool":59,"command":60},"npx","npx skills add claude-office-skills\u002Fskills --skill doc-parser",{"tool":62,"command":63},"bunx","bunx skills add claude-office-skills\u002Fskills --skill doc-parser",{"tool":65,"command":66},"pnpm","pnpm dlx skills add claude-office-skills\u002Fskills --skill doc-parser","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fclaude-office-skills\u002Fskills\u002Fblob\u002Fmain\u002Fdoc-parser\u002FSKILL.md",true,[],[71,78,84,91,98,105],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M72A0X7X4TWS4ZWTEK8TJEC8","devops-automation","DevOps and IT Ops automation - CI\u002FCD, monitoring, incident management, and infrastructure workflows","https:\u002F\u002Fgithub.com\u002Fclaude-office-skills\u002Fskills\u002Fblob\u002Fmain\u002Fdevops-automation\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M72A0VPXF4Q5F48TPDG6S10Q","dev-slides","https:\u002F\u002Fgithub.com\u002Fclaude-office-skills\u002Fskills\u002Fblob\u002Fmain\u002Fdev-slides\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M72A0Q1T0KN60CR3PAD93J6T","deep-research","Conduct comprehensive research on any topic. Synthesize information from multiple angles, provide structured analysis, and generate detailed research reports.","https:\u002F\u002Fgithub.com\u002Fclaude-office-skills\u002Fskills\u002Fblob\u002Fmain\u002Fdeep-research\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":19},"01M72A0KWAYEWQJMDRGC0WTT7V","dcf-valuation","Build Discounted Cash Flow (DCF) valuation models. Calculate intrinsic value with customizable assumptions. Generate professional valuation reports.","https:\u002F\u002Fgithub.com\u002Fclaude-office-skills\u002Fskills\u002Fblob\u002Fmain\u002Fdcf-valuation\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":19},"01M72A0GVWRZ3HZNXMW3RB5CF9","Database Sync","Automate database synchronization, replication, migration, and cross-platform data integration","https:\u002F\u002Fgithub.com\u002Fclaude-office-skills\u002Fskills\u002Fblob\u002Fmain\u002Fdatabase-sync\u002FSKILL.md",[],[],{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":19},"01M72A0E16K862EDP0QYEAC9HJ","data-pipeline","Data pipeline and ETL automation - extract, transform, load workflows for data integration and analytics","https:\u002F\u002Fgithub.com\u002Fclaude-office-skills\u002Fskills\u002Fblob\u002Fmain\u002Fdata-pipeline\u002FSKILL.md",[],[]]