QQ Doc is a simple document management system.
Project description
腾讯文档 API SDK
根据《腾讯文档——开发文档》实现了 API 接口。
请区分腾讯文档和企业微信文档,前者域名 docs.qq.com,后者域名是 doc.weixin.qq.com
功能特点:
- token 有 cache
- 基本接口有封装
- 合并接口封装,比如单接口实现上传文档等
安装
pip install qq-doc
上传 xlsx 文件并转换的示例
Demo 中有 xlsx 的文档上传到指定目录下的示例,需要替换自己的 client_id 和 client_secret。
from qq_doc import QQDocAPI
client_id = "your_client_id"
client_secret = "your_client_secret"
folder_name = "test"
filename = "test.xlsx"
api = QQDocAPI(client_id, client_secret)
folder = api.create_folder_if_not_exist(folder_name)
new_file = api.upload_file(filename, folder["ID"])
# 加一个公开写权限,也可以使用publicRead, private, members
api.set_file_permission(new_file["ID"], "publicWrite")
print(new_file)
注意:腾讯文档支持同名文件的存在,所以如果多次执行,会产生多个文件,他们的ID不同,但是命名相同。请记得清理
接口实现情况
文件操作
| 接口 | 方法名称 |
|---|---|
| 新建文档 | |
| 查询文档 | |
| 重命名文档 | |
| 移动文档 | |
| 删除文档 | delete_folder |
| 生成副本 | |
| 收藏文档 | |
| 置顶文档 | |
| 设置水印 | |
| 创建快捷方式 | |
| 恢复文档 |
导入文件
| 接口 | 方法名称 |
|---|---|
| 预导入文档 | create_import_info |
| 异步导入文档 | async_import_document |
| 查询导入进度 | get_import_progress |
| [封装]同步导入文档 | upload_file |
导出文件
| 接口 | 方法名称 |
|---|---|
| 导出文档 | |
| 导出进度查询 |
文件夹操作
| 接口 | 方法名称 |
|---|---|
| 获取文档列表 | list_folder_contents |
| 查询文件夹信息 | get_folder_metadata |
| [封装]根据文件名获得文件列表 | get_folder_by_name |
| 添加文件夹 | create_folder |
| [封装]创建文件夹如果不存在 | create_folder_if_not_exist |
| 删除文件夹 | delete_folder |
| 查询文件夹权限 | |
| 移动文件夹 | |
| 重命名文件夹 |
文档权限
| 接口 | 方法名称 |
|---|---|
| 查询用户访问权限 | get_file_access |
| 转让文档所有权 | |
| 查看文档权限 | get_file_permission |
| 设置文档权限 | set_file_permission |
| 申请文档权限 | |
| 添加协作成员 | add_collaborators |
| 移除协作成员 | |
| 查询协作成员 | get_collaborators |
搜索
| 接口 | 方法名称 |
|---|---|
| 列表过滤 | |
| 关键字搜索 |
功能接口
| 接口 | 方法名称 |
|---|---|
| fileID 转换 | |
| 上传图片 |
通知
| 接口 | 方法名称 |
|---|---|
| 查询消息列表未读数量 |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
qq_doc-0.1.0.dev3.tar.gz
(8.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qq_doc-0.1.0.dev3.tar.gz.
File metadata
- Download URL: qq_doc-0.1.0.dev3.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
073b3c74c2c4088030b255efed842463db3160011396bbfffa80973e5880fa79
|
|
| MD5 |
36b4f4a969d6f91f7fb02b16eb3420a4
|
|
| BLAKE2b-256 |
be4c5fe153372c91b11cbe650eb529ff2076b827f81d04c692052d4433ccc1e9
|
File details
Details for the file qq_doc-0.1.0.dev3-py3-none-any.whl.
File metadata
- Download URL: qq_doc-0.1.0.dev3-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5da7e5fc9a68a6a6bbd7a2eacf18bf186e7b99a7cc22dbf87f0c25375ad903cb
|
|
| MD5 |
de938c0f153774d59b5d090c6e6e2565
|
|
| BLAKE2b-256 |
2694eaadaaaa1cc4a0d0c4df467ef71825c3f809295bf37a19398eba132ec166
|