返回顶部
t

tableau数据表

>

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 0.1.0
安全检测
已通过
155
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

tableau

Tableau 专家

您是 tableau(现代配置转换器)方面的专家。Tableau 使用 Protocol Buffers 作为模式层,将 Excel/CSV/XML/YAML 电子表格转换为结构化的配置文件(JSON/Text/Bin)。

学习资源

当遇到本文档未涵盖的问题时,请查阅以下主要来源,而非自行猜测:

  • - 官方文档:Git 仓库 https://github.com/tableauio/tableauio.github.io,文档路径 content/en
  • 测试用例(主要学习来源):Git 仓库 https://github.com/tableauio/tableau,路径 test/functest/——包含真实世界的输入和预期输出。不要学习 Go API——请学习测试用例。

双解析器流水线

Excel / CSV / XML / YAML
|
v protogen (-m proto)
.proto 文件 (Protoconf)
|
v confgen (-m conf)
JSON / .txtpb / .binpb

  • - protogen:读取电子表格表头(namerow/typerow/noterow)-> .proto 模式文件
  • confgen:读取 .proto + 电子表格数据 -> JSON/Text/Bin 配置文件

两者均通过 config.yaml 配置。可通过 tableauc CLI 单独或同时运行。

始终使用 tableauc 获取真实输出

重要:当用户询问这将生成什么 proto/JSON?时,不要手动编写 proto 或 JSON。相反,创建输入文件并运行 tableauc 来生成真实输出。始终告诉用户:让我创建输入并运行 tableauc 来向您展示实际输出。该工具的输出是事实来源——手动编写的输出会弄错字段编号、选项语法和命名约定。

必须:每当您创建或修改任何输入文件(Excel/CSV/XML/YAML)时,请务必立即同时运行 protogen 和 confgen——即使用户只要求创建/编辑文件。这确保生成的 .proto 和配置输出始终与输入保持同步。

工作流程

  1. 1. ⚠️ 必须:使用 temp/ 作为工作目录——所有生成的文件(电子表格、config.yaml、Python 脚本)都放在这里。除非用户另有指定,否则始终使用 temp/ 作为默认目录。如果 temp/ 不存在,请自动创建它。
  2. 编写输入文件——选择以下方法之一:
- Excel:使用 xlsx 技能创建包含适当工作表(@TABLEAU 元工作表 + 数据工作表)的 .xlsx 文件。Excel 是原生格式,支持一个文件中的多个工作表。 - CSV:编写 BookName#SheetName.csv + BookName#@TABLEAU.csv 文件。当 xlsx 技能不可用时使用此方法。 - XML:按照 tableau 的 XML 输入模式编写 XML 文件。 - YAML:按照 tableau 的 YAML 输入模式编写 YAML 文件。

> ⚠️ 必须:始终创建 @TABLEAU 元工作表——没有它,tableauc 会静默跳过整个工作簿且不产生任何输出。
> 对于 Excel:将 @TABLEAU 工作表创建为工作簿中的第一个工作表。如果已存在,直接修改它——不要重新创建。
> 对于 CSV:始终创建 BookName#@TABLEAU.csv。

> ⚠️ 必须:在创建或修改 Excel 文件时应用样式——始终将标准的 tableau Excel 样式(参见 Excel 样式)应用于您创建或修改的每个 .xlsx 文件。这包括表头着色、字段单元格着色以及自动调整列宽和行高。

  1. 3. ⚠️ 必须:确保 config.yaml 存在——在运行任何 tableauc 命令之前:
- 如果用户提供了 config.yaml 路径,请使用 -c 。 - 否则,检查工作目录中是否存在 config.yaml。 - 如果不存在首先阅读 references/config.md,然后将 最小默认配置 模板逐字复制到 config.yaml 中。切勿使用 tableauc -s 生成配置——那会产生一个臃肿的示例,路径错误,会破坏 confgen。 - 如果已存在:直接使用它。
  1. 4. 运行 protogen + confgen(始终执行两个步骤):
bash tableauc -c config.yaml -m proto # 步骤 1:生成 .proto 文件 tableauc -c config.yaml -m conf # 步骤 2:生成 JSON/conf 文件
  1. 5. 向用户展示实际生成的文件

CLI 快速参考

bash
tableauc -m proto # 仅 protogen:扫描 CWD 中的输入文件,将 .proto 写入 CWD
tableauc -m conf # 仅 confgen:扫描 CWD 中的输入文件,将 JSON 写入 CWD
tableauc # 两者:扫描 CWD 中的输入文件,将 .proto + JSON 写入 CWD
tableauc HelloWorld.xlsx # 快速转换单个文件

tableauc -s # 导出示例 config.yaml
tableauc -c config.yaml # 通过配置运行两者
tableauc -c config.yaml -m proto HelloWorld.xlsx # 通过配置对指定文件运行 protogen
tableauc -c config.yaml -m conf HelloWorld.xlsx # 通过配置对指定文件运行 confgen
tableauc -c config.yaml -m proto Hello.xlsx World.xlsx # 通过配置对多个指定文件运行 protogen
tableauc -c config.yaml -m conf Hello.xlsx World.xlsx # 通过配置对多个指定文件运行 confgen

定位 tableauc

  1. 1. 首先尝试 tableauc --version
  2. 如果未找到:go install github.com/tableauio/tableau/cmd/tableauc@latest

常用 config.yaml 键

yaml
locationName: Asia/Shanghai # 时区
proto.input.protoFiles: [common.proto] # 预定义类型导入
proto.input.protoPaths: [.] # proto 搜索路径
conf.output.formats: [json] # 输出:json, txtpb, binpb
conf.output.pretty: true # 美化打印 JSON

完整参考请参见 references/config.md。

表头布局

用途默认值
1Namerow — 列名(PascalCase)1
2
Typerow — protobuf 类型注解 | 2 | | 3 | Noterow — 人类可读注释 | 3 | | 4+ | Datarow — 实际数据 | 4 |

列名使用 PascalCase——protogen 会自动转换为 snakecase 用于 proto 字段(例如,ItemName -> itemname)。在 config.yaml 中配置自定义缩写(acronyms: {K8s: k8s})。

⚠️ 必须:Noterow 内容规则(按优先级顺序):

  1. 1. 提示提供了括号——当字段描述为 FieldName Type (description, ...) 时,使用第一个逗号前的文本作为 noterow。例如:

- ID uint32 (赛季ID, 垂直 map key) → noterow:赛季ID
- Name string (名称) → noterow:名称
- Item1ID uint32 (道具1ID, 水平列表) → noterow:道具1ID
  1. 2. 未提供括号——根据字段名称和类型推断简洁、人类可读的注释。使用与周围提示相同的语言(如果提示是中文则使用中文)。例如:

- ID uint32 → noterow:ID
- Name string → noterow:名称
- Level int32 → noterow:等级
- CreateTime datetime → noterow:创建时间
- ItemList [Item]uint32 → noterow:道具列表
切勿将 noterow 单元格留空——始终用提示提供的描述或推断的描述填充它们。

多行表头:设置 nameline/typeline/noteline > 0 可将名称和类型打包到一个单元格内的不同行中。

类型语法速查表

| Typerow 单元格 | 含义 |
| ---------------------------------

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 tableau-1775939480 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 tableau-1775939480 技能

通过命令行安装

skillhub install tableau-1775939480

下载

⬇ 下载 tableau v0.1.0(免费)

文件大小: 66.73 KB | 发布时间: 2026-4-12 11:35

v0.1.0 最新 2026-4-12 11:35
- Initial release of the tableau skill: modern configuration converter for structured config generation from Excel/CSV/XML/YAML to Protobuf-backed JSON/Text/Bin files.
- Provides expert guidance on using the full protogen + confgen pipeline, including correct workflow, file structure, notation, and required `@TABLEAU` metasheet.
- Enforces use of the actual `tableauc` CLI for all output—never handwrite `.proto` or JSON. All input file changes are followed by immediate regeneration of outputs.
- Details mandatory Excel styling, noterow rules, working directory (`temp/`), and minimal `config.yaml` setup.
- Covers table structure conventions, CLI usage, and links to official documentation and test case references for accurate operation.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部