飛書多維表格-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

  • 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:

這個技能的最新版本可以在7w4.net小蔥技能站找到。

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