{"id":37084716,"url":"https://github.com/luisleo526/doc2mark","last_synced_at":"2026-01-14T10:23:53.591Z","repository":{"id":298901032,"uuid":"1001475114","full_name":"luisleo526/doc2mark","owner":"luisleo526","description":"AI-powered Python library that converts any document (PDF, Word, Excel, PowerPoint, HTML) to clean Markdown while preserving complex tables and layouts using AI-Powered OCR technology.","archived":false,"fork":false,"pushed_at":"2025-09-19T19:52:43.000Z","size":12512,"stargazers_count":40,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-30T14:25:30.765Z","etag":null,"topics":["complex-table-structure","langchain","markdown","ocr","openai","python","rag"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luisleo526.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-13T12:51:02.000Z","updated_at":"2025-09-26T07:21:43.000Z","dependencies_parsed_at":"2025-12-08T10:05:48.127Z","dependency_job_id":null,"html_url":"https://github.com/luisleo526/doc2mark","commit_stats":null,"previous_names":["luisleo526/unifydoc","luisleo526/doc2mark"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/luisleo526/doc2mark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luisleo526%2Fdoc2mark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luisleo526%2Fdoc2mark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luisleo526%2Fdoc2mark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luisleo526%2Fdoc2mark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luisleo526","download_url":"https://codeload.github.com/luisleo526/doc2mark/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luisleo526%2Fdoc2mark/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28417030,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:18:03.274Z","status":"ssl_error","status_checked_at":"2026-01-14T10:16:11.865Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["complex-table-structure","langchain","markdown","ocr","openai","python","rag"],"created_at":"2026-01-14T10:23:52.851Z","updated_at":"2026-01-14T10:23:53.573Z","avatar_url":"https://github.com/luisleo526.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# doc2mark\n\n[![PyPI version](https://img.shields.io/pypi/v/doc2mark.svg)](https://pypi.org/project/doc2mark/)\n[![Python](https://img.shields.io/pypi/pyversions/doc2mark.svg)](https://pypi.org/project/doc2mark/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nTurn any document into clean Markdown – in one line.\n\n## Why doc2mark?\n\n- Converts PDFs, DOCX/XLSX/PPTX, images, HTML, CSV/JSON, and more\n- AI OCR for scans and screenshots (OpenAI)\n- Preserves complex tables (merged cells, headers) and basic layout\n- One simple API + CLI for single files or whole folders\n\n## Install\n\n```bash\npip install doc2mark[all]\n```\n\n## Try it in 30 seconds\n\n```python\nfrom doc2mark import UnifiedDocumentLoader\n\nloader = UnifiedDocumentLoader(ocr_provider='openai')  # or None\nresult = loader.load('sample_documents/sample_pdf.pdf', extract_images=True, ocr_images=True)\nprint(result.content)\n```\n\nCLI:\n\n```bash\n# single file → stdout\ndoc2mark sample_documents/sample_document.docx\n\n# directory → save files (recursively)\ndoc2mark sample_documents -o output -r\n\n# enable OCR with OpenAI\nexport OPENAI_API_KEY=sk-...        # Windows: set OPENAI_API_KEY=...\ndoc2mark sample_documents/sample_pdf.pdf --ocr openai --ocr-images\n```\n\n## Supported formats\n\n- PDF • DOCX • XLSX • PPTX • Images (PNG/JPG/WEBP) • TXT/CSV/TSV/JSON/JSONL • HTML/XML/MD\n- Legacy Office (DOC/XLS/PPT/RTF/PPS) via LibreOffice (optional)\n\n## Common recipes\n\n```python\nfrom doc2mark import UnifiedDocumentLoader\n\nloader = UnifiedDocumentLoader(ocr_provider='openai')\n\n# 1) Single file → Markdown string\nprint(loader.load('document.pdf').content)\n\n# 2) Image with OCR\nprint(loader.load('screenshot.png', extract_images=True, ocr_images=True).content)\n\n# 3) Batch a folder and save outputs\nloader.batch_process(\n    input_dir='documents/',\n    output_dir='converted/',\n    extract_images=True,\n    ocr_images=True,\n    show_progress=True,\n    save_files=True\n)\n```\n\n## OpenAI OCR (optional)\n\n```bash\nexport OPENAI_API_KEY=your_key   # Windows: set OPENAI_API_KEY=your_key\n```\n\n```python\nloader = UnifiedDocumentLoader(ocr_provider='openai')\n# Need a cheaper model? Use model='gpt-4o-mini'\n```\n\nUse OpenAI‑compatible endpoints (self‑hosted/offline VLM):\n\n```python\n# Example: point to an OpenAI‑compatible server (must support vision)\nloader = UnifiedDocumentLoader(\n    ocr_provider='openai',\n    base_url='http://localhost:11434/v1',  # your OpenAI‑compatible endpoint\n    api_key='your-key-or-any-string',      # some servers require a token\n    model='gpt-4o-mini'\n)\n```\n\n## Tips\n\n- Use `extract_images=True, ocr_images=True` to convert images to text\n- `batch_process(..., save_files=True)` writes `.md` (and `.json` when requested)\n- Sample files live in `sample_documents/` — perfect for a quick test\n\n## License\n\nMIT — see `LICENSE`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluisleo526%2Fdoc2mark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluisleo526%2Fdoc2mark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluisleo526%2Fdoc2mark/lists"}