# doc2docx **Repository Path**: hanhuafeng/doc2docx ## Basic Information - **Project Name**: doc2docx - **Description**: 提供doc转docx的文件服务工具 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2025-12-18 - **Last Updated**: 2025-12-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # doc2docx #### 介绍 提供doc转docx的文件服务工具 #### 软件架构 软件架构说明 基础镜像: ubuntu:22.04 转换工具: libreoffice 服务提供: python311 + fastapi #### 安装教程 1. 下载源码: git clone https://gitee.com/yanghaitao2025/doc2docx.git 2. python版本: python3.11 3. 安装依赖:pip install -r requirements.txt 4. 构建镜像:docker build -t doc2docx:v1.0 . 5. 保存镜像:docker save -o doc2docx_v1.0.tar doc2docx:v1.0 #### 使用说明 1. 下载镜像:doc2docx_v1.0.tar 2. 加载到docker中:docker load < doc2docx_v1.0.tar 3. 查看镜像:docker images 4. 启动镜像:docker run -d -p 8000:8000 --name doc2docx doc2docx:v1.0 5. 查看docker日志: docker logs -f 445d5818fb70 6. 访问服务示例见: ```python # pip install requests import requests def doc2docx(local_path: str, doc_file: str): url = "http://localhost:8000/translate/doc" response = requests.post(url, files={"file": open(f"{local_path}/{doc_file}", "rb")}) if response.status_code == 200: with open(f"{local_path}/{doc_file}x", "wb") as output_file: output_file.write(response.content) print("文件转换并保存成功") return f"{local_path}/{doc_file}x" else: print(f"请求失败,状态码: {response.status_code}") print(f"响应内容: {response.text}") return None # 本地doc文件 local_path = "C:\\Users\\HUAWEI\\Desktop" doc_file = "data***2.doc" output_file = doc2docx(local_path, doc_file) print(output_file) ``` #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request #### 特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)