Third-party Python SDK for Feishu Open Platform API
Project description
SDKFeishu - 飞书开放平台Python SDK
一个基于飞书开放平台API,简单易用的非官方Python SDK,提供获取访问令牌、Bitable表格记录CRUD操作、文件上传下载等功能。
功能特性
- 获取飞书访问令牌
- 多维表格(bitable)操作:
- 知识空间管理
- 表格记录CRUD操作
- 文件上传与下载
- 全面且详细的功能文档
环境要求
- Python 3.6+
通过 pip 安装
pip install SDKFeishu
依赖安装
直接通过 pip 安装的 SDKFeishu 无需再手动安装依赖
pip install requests requests-toolbelt
快速开始
from SDKFeishu import get_access_token, Bitable
# 1. 获取访问令牌
app_id = "your_app_id"
app_secret = "your_app_secret"
access_token = get_access_token(app_id, app_secret)
# 2. 初始化Bitable客户端
bitable = Bitable(access_token, "your_app_token")
# 3. 使用示例 - 查询表格记录
records = bitable.find_table_record("your_table_id")
print(records)
API参考
获取访问令牌
get_access_token(app_id: str, app_secret: str) -> str
Bitable类方法
get_wiki_space_list()- 获取知识空间列表get_wiki_child_space_list(space_id)- 获取子空间列表get_wiki_space_info(space_id)- 获取知识空间信息find_table_record(table_id)- 查询表格记录create_table_record(table_id, fields)- 创建记录update_table_record(table_id, record_id, fields)- 更新记录delete_table_record(table_id, record_id)- 删除记录upload_media(file, file_name, file_size, parent_node)- 上传文件download_media_by_link(file_token)- 下载文件
错误处理
所有方法在请求失败时会返回包含状态码和错误信息的字符串
贡献
欢迎提交 Pull Request 或 Issue 报告问题
许可证
MIT
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
sdkfeishu-0.0.1.tar.gz
(4.8 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 sdkfeishu-0.0.1.tar.gz.
File metadata
- Download URL: sdkfeishu-0.0.1.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed47fd97f54ee4f1504681623c892775918e2466a35807e0c39286ea5c2b799f
|
|
| MD5 |
cb0c0b02c7d299f745c41f13ceb64e65
|
|
| BLAKE2b-256 |
99e1fcb4d1d31b2ac08360ff042a4f104351eba6791e93bfe032fd729f5d4504
|
File details
Details for the file sdkfeishu-0.0.1-py3-none-any.whl.
File metadata
- Download URL: sdkfeishu-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44b30a99be0f140d2aa46e7c62a6c68639de75196f0bf6cf97d4f862e63a81e5
|
|
| MD5 |
a7d40b85c0e63e77df7adf64122eba8c
|
|
| BLAKE2b-256 |
06817ce7bb6ab24b009f45a1d03d5e2e767b1ef3a82246b701c993ae21f80852
|