技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
zo-dataset-creator【数据与研究】Create Zo Datasets correctly formatted for the Zo UI. Use when creating a new dataset from scratch, setting up a dataset with proper datapackage.json, schema.yaml, and data.duckdb structure, fixing existing datasets that don't display tables in the Zo UI, or generating schema.yaml from an existing DuckDB database. Handles common pitfalls of manual sc…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Create Zo Datasets with correct formatting for the Zo Datasets UI.
Use scripts/create_dataset.py to scaffold a new dataset:
python3 scripts/create_dataset.py <dataset-name>
This creates:
datapackage.json with required metadatagenerate_schema.py for schema generationschema.yaml (auto-generated after database creation)ingest/, source/, assets/ directoriesREADME.md and PROCESS.md templatesIf tables don't show in the Zo UI:
datapackage.json existsdata.duckdb is a valid databasepython3 generate_schema.pySee TROUBLESHOOTING.md for common issues.
A valid Zo Dataset requires:
dataset-name/
├── datapackage.json # Required: Dataset metadata
├── schema.yaml # Required: Auto-generated from database
├── data.duckdb # Required: DuckDB database
├── generate_schema.py # Required: Script to generate schema
├── README.md # Recommended: Dataset documentation
├── PROCESS.md # Recommended: Ingestion instructions
├── ingest/ # Optional: Ingestion scripts
├── source/ # Optional: Raw source files
└── assets/ # Optional: Generated files
ALWAYS auto-generate schema.yaml from the database. Never write it manually.
The Zo UI expects this format (list of tables with name: keys):
tables:
- name: my_table
row_count: 10
columns:
- name: id
type: VARCHAR
- name: title
type: VARCHAR
- name: created_at
type: TIMESTAMP
This format is generated by generate_schema.py.
Do NOT use manual YAML format (nested dictionaries):
# WRONG - Will not display in Zo UI
tables:
my_table:
columns:
id:
type: VARCHAR
create_dataset.pyCreate a new dataset scaffold:
python3 scripts/create_dataset.py my-dataset
Creates the dataset in Datasets/my-dataset/ with all required files.
generate_schema.pyGenerate schema from an existing database:
cd /home/workspace/Datasets/my-dataset
python3 generate_schema.py
When to run:
data.duckdbvalidate_dataset.pyValidate a dataset structure:
python3 scripts/validate_dataset.py /home/workspace/Datasets/my-dataset
Checks:
datapackage.json exists and is validdata.duckdb exists and is readableschema.yaml exists and is in correct format# 1. Create scaffold
python3 scripts/create_dataset.py sales-data
# 2. Copy CSV to source/
cp sales.csv /home/workspace/Datasets/sales-data/source/
# 3. Create database and import data
cd /home/workspace/Datasets/sales-data
python3 -c "
import duckdb
con = duckdb.connect('data.duckdb')
con.execute(\"CREATE TABLE sales AS SELECT * FROM 'source/sales.csv'\")
con.execute(\"COMMENT ON TABLE sales IS 'Monthly sales data'\")
con.close()
"
# 4. Generate schema
python3 generate_schema.py
# 5. View in Zo UI at /?t=datasets
# 1. Validate to identify issues
python3 scripts/validate_dataset.py /home/workspace/Datasets/broken-dataset
# 2. If schema format is wrong, re-generate
cd /home/workspace/Datasets/broken-dataset
python3 generate_schema.py
# 3. Validate again
python3 scripts/validate_dataset.py /home/workspace/Datasets/broken-dataset
import duckdb
con = duckdb.connect('data.duckdb')
# Add table comment
con.execute("COMMENT ON TABLE videos IS 'YouTube videos from watchlist playlist'")
# Add column comments
con.execute("COMMENT ON COLUMN videos.title IS 'Video title from YouTube'")
con.execute("COMMENT ON COLUMN videos.view_count IS 'Total view count'")
con.close()
# Re-generate schema to include comments
# (run: python3 generate_schema.py)
Add inline comments to tables and columns — they're extracted into schema.yaml:
CREATE TABLE videos (
id VARCHAR PRIMARY KEY COMMENT 'YouTube video ID',
title VARCHAR COMMENT 'Video title from YouTube metadata',
published_at TIMESTAMP COMMENT 'When the video was published'
) COMMENT 'Collection of videos from the watchlist playlist'
Always re-run generate_schema.py after database changes:
playlist_videos, user_sessions, transactionsvideo_id, created_at, total_amountInclude:
See TROUBLESHOOTING.md for detailed solutions to: