{"id":20779431,"url":"https://github.com/freedomintelligence/pdf_to_markdown_tool","last_synced_at":"2026-01-21T05:08:44.365Z","repository":{"id":248476058,"uuid":"828789814","full_name":"FreedomIntelligence/pdf_to_markdown_tool","owner":"FreedomIntelligence","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-09T12:05:12.000Z","size":47,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-04-09T15:57:18.544Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FreedomIntelligence.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-07-15T06:16:12.000Z","updated_at":"2024-10-09T12:05:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"d9be35ef-1c6e-4838-8a1d-121683b3da87","html_url":"https://github.com/FreedomIntelligence/pdf_to_markdown_tool","commit_stats":null,"previous_names":["freedomintelligence/pdf_to_markdown_tool"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FreedomIntelligence/pdf_to_markdown_tool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreedomIntelligence%2Fpdf_to_markdown_tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreedomIntelligence%2Fpdf_to_markdown_tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreedomIntelligence%2Fpdf_to_markdown_tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreedomIntelligence%2Fpdf_to_markdown_tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FreedomIntelligence","download_url":"https://codeload.github.com/FreedomIntelligence/pdf_to_markdown_tool/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreedomIntelligence%2Fpdf_to_markdown_tool/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28627388,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":[],"created_at":"2024-11-17T13:27:54.803Z","updated_at":"2026-01-21T05:08:44.347Z","avatar_url":"https://github.com/FreedomIntelligence.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pdf_to_markdown_tool\n# PDF 转 Markdown 转换工具\n\n这是一个简单的工具，用于将PDF文件转换为Markdown格式。\n\n## 依赖\n\n- Python 3.x\n- `pdfplumber` 库\n- `markdownify` 库\n- `tqdm` 库\n- `Pillow` 库\n- `marker-pdf` 库\n- `libgl1-mesa-glx` 软件包。等等\n\npython 3.11（主要和torch，numpy等版本适配即可）\n\nrequirements.txt\n\n建议先不要直接pip -r，先搭建pytorch环境，其他包如libgl1-mesa-glx，scapy,marker-pdf手动装，没有多少\n\n如下：\n\n```bash\nsudo apt update\nsudo apt install libgl1-mesa-glx\npip install marker-pdf\n```\n\n## 位置设置\n```bash\nos.environ[\"HF_DATASETS_CACHE\"] = \"xxx/xxx/xxx\"       #指定了 Hugging Face Datasets 库缓存数据集的位置\nos.environ[\"HF_HOME\"] = \"xxx/xxx/xxx\"                 #指定了 Hugging Face 库的主目录\nos.environ[\"HUGGINGFACE_HUB_CACHE\"] = \"xxx/xxx/xxx\"   #指定了 Hugging Face Hub 库缓存模型和数据集的位置\nos.environ[\"TRANSFORMERS_CACHE\"] = \"xxx/xxx/xxx\"      #指定了 Hugging Face Transformers 库缓存模型的位置。\nos.environ[\"HF_ENDPOINT\"] = \"https://hf-mirror.com\"   #指定了 Hugging Face 库访问模型和数据集的服务器地址\n\nbase_path = '/xxx/xxx/'                               #指定存放 PDF 文件位置的地址\noutput_dir = '/xxx/xxx'                               #指定存放 Markdown文件、out_meta、image文件\n```\n\n\n## 参数调整\n在`convert`函数`max_pages`中，可以设置最大转换页数。`langs`设置识别语言。`start_page`设置从第几页开始\n\n在`collect_all_target_pdf`函数中，采用多进程的方式进行并行处理，可以进行更改为多线程。并且在`max_workers`中设置最大线程数。\n\n## 运行脚本\n ```bash\npython converter.py\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreedomintelligence%2Fpdf_to_markdown_tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreedomintelligence%2Fpdf_to_markdown_tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreedomintelligence%2Fpdf_to_markdown_tool/lists"}