skills/ppt-station-skill/scripts/list_presets.py
wangyitong a65adcc2e5 Initial commit: merged, deduplicated, and vetted skill collection
Sources: extracted from two upstream archives (skill-repo, skills-main),
merged with the following policy:

- 15 broken symlinks (pointing to /Users/jameslee/.cc-switch/skills or
  ../../.agents/skills on a foreign machine) discarded
- 3 real name collisions with identical content (ai-pair, ifind-http-api,
  zhipu-websearch) kept as one copy
- Functional overlaps deduped keeping the strongest variant:
  - docx family: kept docx (official, full toolchain) + docx-cn
    (GB/T 9704 Chinese official-document constants),
    dropped docx_writer (no scripts, name collided with docx)
  - humanizer family: kept humanizer-zh (6 zh reference docs),
    dropped humanizer (en, redundant for CN workflow)
- Skills that only ran in a foreign environment removed:
  ablemind-ops, app-publish, hlb-design-system, openclaw-adj-skill,
  claude-driver
- alphapai excluded from this public repo because its SKILL.md hard-coded
  live credentials

Result: 25 skills, 572 files, ~7.5 MB.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-13 14:47:12 +08:00

79 lines
2.4 KiB
Python

#!/usr/bin/env python3
"""查询 ppt_station 包中所有可用预设
用法:
python list_presets.py [--color-schemes | --date-axis | --chart-presets | --all]
输出 (stdout): JSON
"""
import sys
import json
import argparse
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
def get_color_schemes():
from ppt_station.chart_builder.styles import COLOR_SCHEMES
return {name: colors for name, colors in COLOR_SCHEMES.items()}
def get_date_axis_presets():
from ppt_station.chart_builder.date_axis import (
DAILY_TICKS, WEEKLY_TICKS, BIWEEKLY_TICKS,
MONTHLY_TICKS, QUARTERLY_TICKS, YEARLY_TICKS,
)
presets = {
"DAILY_TICKS": DAILY_TICKS,
"WEEKLY_TICKS": WEEKLY_TICKS,
"BIWEEKLY_TICKS": BIWEEKLY_TICKS,
"MONTHLY_TICKS": MONTHLY_TICKS,
"QUARTERLY_TICKS": QUARTERLY_TICKS,
"YEARLY_TICKS": YEARLY_TICKS,
}
result = {}
for name, cfg in presets.items():
result[name] = {
"base_unit": cfg.base_unit,
"major_unit": cfg.major_unit,
"major_unit_scale": cfg.major_unit_scale,
"number_format": cfg.number_format,
}
return result
def get_chart_presets():
from ppt_station.template.chart_presets import CHART_PRESET_FUNCTIONS
return list(CHART_PRESET_FUNCTIONS.keys())
def main():
parser = argparse.ArgumentParser(description="查询所有可用预设")
group = parser.add_mutually_exclusive_group()
group.add_argument("--color-schemes", action="store_true", help="仅显示配色方案")
group.add_argument("--date-axis", action="store_true", help="仅显示日期轴预设")
group.add_argument("--chart-presets", action="store_true", help="仅显示图表预设")
group.add_argument("--all", action="store_true", default=True, help="显示全部(默认)")
args = parser.parse_args()
result = {}
if args.color_schemes:
result["color_schemes"] = get_color_schemes()
elif args.date_axis:
result["date_axis_presets"] = get_date_axis_presets()
elif args.chart_presets:
result["chart_presets"] = get_chart_presets()
else:
result["color_schemes"] = get_color_schemes()
result["date_axis_presets"] = get_date_axis_presets()
result["chart_presets"] = get_chart_presets()
print(json.dumps(result, ensure_ascii=False, indent=2))
if __name__ == "__main__":
main()