{"id":20450015,"url":"https://github.com/turboway/fileparse","last_synced_at":"2025-07-30T12:33:31.932Z","repository":{"id":104902634,"uuid":"333336366","full_name":"TurboWay/fileparse","owner":"TurboWay","description":"文件通用解析服务","archived":false,"fork":false,"pushed_at":"2021-01-29T04:56:27.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-22T19:42:20.871Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/TurboWay.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":"2021-01-27T07:18:11.000Z","updated_at":"2021-01-29T04:56:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"8664846d-520f-49f5-b696-ad8d725648d0","html_url":"https://github.com/TurboWay/fileparse","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TurboWay/fileparse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TurboWay%2Ffileparse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TurboWay%2Ffileparse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TurboWay%2Ffileparse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TurboWay%2Ffileparse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TurboWay","download_url":"https://codeload.github.com/TurboWay/fileparse/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TurboWay%2Ffileparse/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267867803,"owners_count":24157357,"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-07-30T02:00:09.044Z","response_time":70,"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":[],"created_at":"2024-11-15T10:49:40.119Z","updated_at":"2025-07-30T12:33:31.904Z","avatar_url":"https://github.com/TurboWay.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fileparse\n文件通用解析服务\n\n# 说明\n\n| 文件格式  |  是否支持  |  实现方法  |\n| ------------ | ------------ | ------------ |\n| 图片（jpg、png、bmp、gif） |  √  | paddleocr |\n| pdf  |  √  | pdfplumber |\n| docx  |  √  | python-docx  |\n| doc  |  √  | windows 使用 pypiwin32 转 docx \u003cbr\u003e linux 使用 antiword 直接解析, [如何安装 antiword](antiword.md) |\n\n# 安装\n\n```\npip install paddlepaddle==2.0.0rc1 -i https://mirror.baidu.com/pypi/simple\npip install paddleocr -i https://mirror.baidu.com/pypi/simple\npip install pdfplumber\npip install python-docx\npip install flask\n```\n\nwindow 环境需要安装\n\n```\npip install pywin32\n```\n\n\n# 使用（客户端）\n\n直接调用解析函数即可\n\n```python\nfrom utils.parse import parse\n\ntest_list = [\n    'test.bmp',\n    'https://gitee.com/TurboWay/blogimg/raw/master/img/test.jpg',\n    'https://gitee.com/TurboWay/blogimg/raw/master/img/test.png',\n    'https://gitee.com/TurboWay/blogimg/raw/master/img/test.doc',\n    'https://gitee.com/TurboWay/blogimg/raw/master/img/test.docx',\n    'https://gitee.com/TurboWay/blogimg/raw/master/img/test.pdf'\n]\n\nfor path in test_list:\n    issuccess, content = parse(path)\n    print(path, issuccess, content)\n```\n\n# 使用（服务端）\n\n运行 server.py，就可以直接使用文件解析 api \n\n**请求URL：**\n- ` http://127.0.0.1:9527/openapi/parse `\n\n**请求方式：**\n- POST\n\n**参数：**\n\n|参数名|必选|类型|说明|\n|:----    |:---|:----- |-----   |\n|fileData | 是 |string |  文件内容的base64字符串  |\n|fileType | 是 |string |  文件类型  |\n|t | 是 |int | 当前时间戳  |\n|token | 是 |string | token。生成方式：md5(key+当前时间戳)，默认 key 为 fileparse  |\n\n **返回示例**\n\n```\n{\n    'errorMessage': '', \n    'result': '首先请您选择您的版本\\n如果您的计算机没有NVIDIAGPU，请安装CPU版的PaddlePaddle\\n如果您的计算机有NVIDIA@GPU，请确保满足以下条件并且安装GPU版PaddlePaddlle\\nOCUDA工具包9.0/10.0配合CuDNNv7.3+\\n·GPU运算能力超过1.0的硬件设备\\n您可参考NVIDIA官方文档了解CUDA和CUDNN的安装流程和配置方法，请见CUDA，cuDNN', \n    'success': True\n}\n\n```\n\n **返回参数说明**\n\n|参数名|类型|说明|\n|:-----  |:-----|-----                           |\n|success | bool | 调用成功标识，true:成功 false:失败 |\n|errorMessage | string | 错误信息 |\n|result | string | 识别结果|\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fturboway%2Ffileparse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fturboway%2Ffileparse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fturboway%2Ffileparse/lists"}