{"id":33333914,"url":"https://github.com/carloscasalar/pdf2md-ocr","last_synced_at":"2026-01-18T13:13:42.683Z","repository":{"id":324596686,"uuid":"1097768336","full_name":"carloscasalar/pdf2md-ocr","owner":"carloscasalar","description":"A Python CLI tool to convert PDFs to markdown using OCR","archived":false,"fork":false,"pushed_at":"2025-11-16T19:47:59.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-16T21:21:29.474Z","etag":null,"topics":["cli","markdown-generator","pdf-converter","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/carloscasalar.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-11-16T19:40:22.000Z","updated_at":"2025-11-16T19:49:14.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/carloscasalar/pdf2md-ocr","commit_stats":null,"previous_names":["carloscasalar/pdf2md-ocr"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/carloscasalar/pdf2md-ocr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carloscasalar%2Fpdf2md-ocr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carloscasalar%2Fpdf2md-ocr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carloscasalar%2Fpdf2md-ocr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carloscasalar%2Fpdf2md-ocr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carloscasalar","download_url":"https://codeload.github.com/carloscasalar/pdf2md-ocr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carloscasalar%2Fpdf2md-ocr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285532716,"owners_count":27187775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-20T02:00:05.334Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cli","markdown-generator","pdf-converter","python"],"created_at":"2025-11-21T00:06:20.901Z","updated_at":"2026-01-18T13:13:42.664Z","avatar_url":"https://github.com/carloscasalar.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pdf2md-ocr\n\nSimple CLI tool to convert PDFs to Markdown using [Marker AI](https://github.com/VikParuchuri/marker).\n\n## Quick Start\n\n**Recommended (no installation needed):**\n\n```bash\nuvx pdf2md-ocr input.pdf -o output.md\n```\n\n**Traditional installation:**\n\n```bash\npip install pdf2md-ocr\npdf2md-ocr input.pdf -o output.md\n```\n\n## Usage\n\n```bash\n# Convert PDF to Markdown (output same name with .md extension)\npdf2md-ocr document.pdf\n\n# Specify output file\npdf2md-ocr document.pdf -o result.md\n\n# Convert specific page range (page numbering starts at 1)\npdf2md-ocr document.pdf --start-page 2 --end-page 5\n\n# Convert from page 3 to the end\npdf2md-ocr document.pdf --start-page 3\n\n# Convert from the beginning to page 10\npdf2md-ocr document.pdf --end-page 10\n\n# Show cache location and size\npdf2md-ocr document.pdf --show-cache-info\n\n# Show help\npdf2md-ocr --help\n\n# Show version\npdf2md-ocr --version\n```\n\n### Page Range Options\n\n- `--start-page N`: Starting page number (1-based, inclusive). If omitted, starts from page 1.\n- `--end-page M`: Ending page number (1-based, inclusive). If omitted, goes to the last page.\n\nBoth options are optional and can be combined:\n\n- Use only `--start-page` to convert from a specific page to the end.\n- Use only `--end-page` to convert from the beginning to a specific page.\n- Use both to convert a specific range.\n\n**Important: Page numbering starts at 1** (not 0).\n\n## First Run\n\nThe first time you run pdf2md-ocr, it will download ~2-3GB of AI models. These models are cached locally and reused for all future conversions.\n\n**To see where models are cached:**\n\n```bash\npdf2md-ocr input.pdf --show-cache-info\n```\n\nThis will show the cache location and size after conversion. Cache locations, typically:\n\n- macOS: `~/Library/Caches/datalab/models/`\n- Linux: `~/.cache/datalab/models/`\n- Windows: `%LOCALAPPDATA%\\datalab\\models\\`\n\n**To clear the cache:** Simply delete the cache directory shown in the info above, or use `make clean-cache` if developing locally.\n\nSubsequent runs will be much faster since the models are already cached.\n\n## Requirements\n\n- Python 3.10 or higher\n- ~2GB disk space for AI models (one-time download)\n\n## System Requirements\n\npdf2md-ocr requires native system libraries for PDF processing. These need to be installed separately on your system:\n\n### macOS (Homebrew)\n\n```bash\nbrew install gobject-introspection pango\nexport DYLD_LIBRARY_PATH=\"/opt/homebrew/lib:$DYLD_LIBRARY_PATH\"\n```\n\nFor permanent setup, add the export line to your shell profile (`~/.zshrc`, `~/.bash_profile`, etc.):\n\n```bash\necho 'export DYLD_LIBRARY_PATH=\"/opt/homebrew/lib:$DYLD_LIBRARY_PATH\"' \u003e\u003e ~/.zshrc\n```\n\n### Linux (Ubuntu/Debian)\n\n```bash\nsudo apt-get update\nsudo apt-get install libgobject-2.0-0 libpango-1.0-0\n```\n\n### Linux (Fedora/RHEL)\n\n```bash\nsudo dnf install gobject-introspection pango\n```\n\n### Windows\n\nDownload and install GTK+ 3 from the [GTK-for-Windows-Runtime-Environment-Installer](https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer).\n\n## Development\n\nFor development, a Makefile is provided with common tasks:\n\n```bash\n# Install dependencies\nmake install-dev\n\n# Run tests\nmake test\n\n# Run tests with verbose output\nmake test-verbose\n\n# Clean build artifacts\nmake clean\n\n# Clear AI model cache (frees ~3GB disk space)\nmake clean-cache\n\n# Build distribution packages\nmake build\n\n# See all available commands\nmake help\n```\n\n## How It Works\n\nThis tool is a minimal wrapper around the excellent [marker-pdf](https://github.com/VikParuchuri/marker) library, which uses AI models to:\n\n1. Detect text, tables, and equations in PDFs\n2. Extract content with proper formatting\n3. Convert to clean Markdown\n\n## License\n\nGPL-3.0-or-later\n\nThis project is licensed under the GNU General Public License v3.0 or later to comply with the [marker-pdf](https://github.com/VikParuchuri/marker) library license (GPL-3.0-or-later).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarloscasalar%2Fpdf2md-ocr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarloscasalar%2Fpdf2md-ocr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarloscasalar%2Fpdf2md-ocr/lists"}