飞书多维表格-Excel同步

👤 Captain 📦 v2.0.0 ⭐ 4.6 ⬇️ 16.5K 下载
📄 办公效率 免费

📖 技能介绍


name: excel-sync-bitable description: Safely import Excel/CSV data into a new or existing Feishu Base, or export a Base table to Excel/CSV. Use when a user needs Excel/CSV and Feishu Base synchronization, especially keyed upserts with a preview and post-write verification.


Excel ↔ Feishu Base

Use scripts/excel_sync_bitable.py. Require an explicit --apply before any Base write.

Preconditions

小葱技能有更好的技能skills插件。

  • Confirm the input file, Base URL, target table and business-key column.
  • Run lark-cli auth status if the user identity or permission is uncertain.
  • Use a Base URL, not a guessed token. The script resolves it with base +url-resolve.

Commands

Preview a keyed sync (no write):

python scripts/excel_sync_bitable.py sync --input .\orders.xlsx --url "https://example.feishu.cn/base/..." --key "订单号"

Apply the reviewed sync and read back its keys:

python scripts/excel_sync_bitable.py sync --input .\orders.xlsx --url "https://example.feishu.cn/base/..." --key "订单号" --apply

Handle source columns that do not exist in the target Base:

# Show missing fields and their inferred types (default; no write)
python scripts/excel_sync_bitable.py sync --input .\orders.xlsx --url "https://example.feishu.cn/base/..." --key "订单号"

# Intentionally ignore absent columns
python scripts/excel_sync_bitable.py sync --input .\orders.xlsx --url "https://example.feishu.cn/base/..." --key "订单号" --missing-fields skip --apply

# Create absent text/number/datetime/checkbox fields, then import
python scripts/excel_sync_bitable.py sync --input .\orders.xlsx --url "https://example.feishu.cn/base/..." --key "订单号" --missing-fields create --apply

Create a Base from a workbook:

python scripts/excel_sync_bitable.py create --input .\orders.xlsx --app-name "订单数据" --table-name "订单" --apply

Export one Base table:

python scripts/excel_sync_bitable.py export --url "https://example.feishu.cn/base/..." --table-name "订单" --output .\orders.xlsx

Safety rules

  • sync updates only records whose business key matches exactly; it does not delete remote records.
  • Stop on blank or duplicate keys in either the source or target table.
  • For absent source columns, default to a no-write prompt with inferred types; explicitly choose --missing-fields skip or --missing-fields create --apply.
  • Treat preview counts as approval material. Use --apply only after the user has confirmed the target and counts.
  • The current implementation supports text, number, date/time and checkbox fields. Handle select, user, attachment, link, formula and lookup fields with a field-specific workflow instead of guessing values.

🤖 AI 评测

这个工具整体质量较好,安全性设计突出——预览确认和写后验证机制能有效避免数据误操作。它支持Excel和CSV导入导出飞书表格,智能识别日期、数字、勾选框等数据类型。不足之处是支持的字段类型较少,人员选择、附件等特殊字段暂时无法处理,另外在数据量很大时的性能表现还有待验证。总体来说,对于常见的文本和数值同步场景,这个工具是比较可靠的选择。

📊 多维度评分

适应性4.6
规范性4.5
有效性4.7
可靠性4.5
可信度5

📁 包含文件 (7 个)

📄 SKILL.md 2.7 KB
📄 requirements.txt 30 B
📄 scripts/excel_sync_bitable.py 18.8 KB
📄 tests/fixtures/live-import-same-value.csv 28 B
📄 tests/fixtures/missing-field-preview.csv 85 B
📄 tests/fixtures/simulated-import.csv 116 B
📄 tests/test_excel_sync_bitable.py 4.7 KB