Skip to main content

飞书开放平台自动化配置工具

飞书开放平台的自动化配置工具,支持应用创建、权限配置、版本管理、事件订阅等功能。

功能特性

  • 🌐 浏览器自动化 - 基于 DrissionPage 实现浏览器操作
  • 📱 应用管理 - 自动创建/选择飞书应用
  • 🔐 权限配置 - 自动导入权限配置
  • 📦 版本管理 - 自动创建和发布版本
  • 🔌 事件订阅 - WebSocket 长连接支持

安装

# 使用 pip 安装
pip install feishu-auto

# 或使用 uv 安装
uv pip install feishu-auto

依赖

  • Python >= 3.12
  • DrissionPage >= 4.0.0
  • lark-oapi >= 1.0.0
  • pyperclip >= 1.8.0

快速开始

命令行使用

# 使用默认应用名称
feishu-auto

# 指定应用名称
feishu-auto -n myapp

# 指定调试端口
feishu-auto -p 9223

# 设置日志级别
feishu-auto -l DEBUG

Python API 使用

from feishu_auto import FeishuBrowser, create_event_client

# 创建浏览器实例
feishu = FeishuBrowser(app_name="myapp")

# 打开飞书并自动配置
tab = feishu.open_feishu()

# 创建事件订阅客户端
client = create_event_client(app_name="myapp")
client.start(block=False)

自定义配置

from feishu_auto import FeishuBrowser
from feishu_auto.config import Config, set_config

# 创建自定义配置
config = Config(
    debug_port=9223,
    default_app_name="custom_app",
    default_version="1.0.0",
)

# 设置全局配置
set_config(config)

# 使用自定义配置
feishu = FeishuBrowser(app_name="custom_app")

项目结构

feishu-auto/
├── src/
│   └── feishu_auto/
│       ├── __init__.py      # 包入口
│       ├── __main__.py      # 模块入口
│       ├── cli.py           # 命令行接口
│       ├── config.py        # 配置管理
│       ├── browser.py       # 浏览器基础类
│       ├── auth.py          # 权限管理
│       ├── app.py           # 应用管理
│       ├── version.py       # 版本管理
│       ├── feishu.py        # 主类
│       └── event.py         # 事件订阅
├── tests/                   # 测试目录
├── examples/                # 示例代码
├── pyproject.toml           # 项目配置
└── README.md               # 说明文档

开发

安装开发依赖

# 克隆项目
git clone https://github.com/yourusername/feishu-auto.git
cd feishu-auto

# 安装开发依赖
pip install -e ".[dev]"

运行测试

pytest tests/

代码检查

# Ruff 检查
ruff check src/

# 类型检查
mypy src/

许可证

MIT License

Metadata

Release files for feishu-auto 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for feishu-auto 0.1.0
File Size Uploaded
feishu_auto-0.1.0.tar.gz 84.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for feishu-auto 0.1.0
File Interpreter ABI Platform
feishu_auto-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 112.8 kB

Release files / feishu_auto-0.1.0.tar.gz

Download URL feishu_auto-0.1.0.tar.gz
Size 84.5 kB
Tags Source
SHA-256 checksum
How to use checksums
849d9335653ee30b5f9f2acf1504749019f6c1449cb4dd712ee3e1dbbbb2ff82
BLAKE2b-256 checksum
How to use checksums
35b22bde703dab439518acb44a0f4342d081e2eb63c15712cd7b725501f6f841
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.3

Release files / feishu_auto-0.1.0-py3-none-any.whl

Download URL feishu_auto-0.1.0-py3-none-any.whl
Size 28.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e8a8f84de9c07fd6d17344d3b7d9150d25749d8aef95ddd65e0ce15846c5a4cc
BLAKE2b-256 checksum
How to use checksums
cee6a9cc2736cd58e80596a59e182011b454ed2689c621a9e38d80bd33425b6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.3

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page