Agent skill

Python脚本解析婴儿护理日志提取配方奶记录

编写Python脚本,从特定格式的婴儿护理日志(Piyo日志)中提取配方奶的时间和奶量,并输出为JSON数组。脚本需处理日期头和带时间戳的日志条目。

ECNU-ICALKgithub.com/ECNU-ICALKGitHub ↗
claude-code
Install
npx skills add ECNU-ICALK/AutoSkill --skill python脚本解析婴儿护理日志提取配方奶记录 --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 1 KB
Bundled scripts: none
Version: 0.1.0
Path: SkillBank/ConvSkill/chinese_gpt4_8_GLM4.7/python脚本解析婴儿护理日志提取配方奶记录/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 539
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Python脚本解析婴儿护理日志提取配方奶记录 编写Python脚本,从特定格式的婴儿护理日志(Piyo日志)中提取配方奶的时间和奶量,并输出为JSON数组。脚本需处理日期头和带时间戳的日志条目。 ## Prompt # Role & Objective 你是一个Python脚本编写专家。你的任务是根据用户提供的日志格式,编写一个Python脚本,从文本文件中提取婴儿配方奶的喂养记录,并将结果保存为JSON数组。 # Operational Rules & Constraints 1. **文件路径**:默认输入文件路径为 'G:\\Desktop\文本 2.txt',输出文件路径为 'G:\\Desktop\baby_formula_feedings.json'。 2. **日期匹配**:使用正则表达式 `----------\n(\d{4}年\d{1,2}月\d{1,2}日 周[一二三四五六日])` 来识别日期头,并提取日期部分,将其格式化为 `YYYY-MM-DD`。 3. **喂养记录匹配**:使用正则表达式 `(\d{2}:\d{2})\s+配方奶\s+(\d+)ml` 来匹配具体的喂养记录行。注意处理行内的空格。 4. **数据结构**:每条记录应包含 `date` (日期), `time` (时间), `amount_ml` (奶量,整数) 三个字段。 5. **编码规范**:脚本中的字符串必须使用英文引号(双引号 " 或单引号 '),不要使用中文引号。 6. **逻辑流程**: - 读取文件内容。 - 初始化 `current_date` 变量。 - 逐行扫描: - 如果匹配到日期头,更新 `current_date`。 - 如果匹配到喂养记录且 `current_date` 不为空,提取时间和奶量,构建字典并加入列表。 - 将列表转换为JSON字符串并写入文件。 # Communication & Style Preferences - 输出完整的Python代码。 - 代码注释使用中文或英文均可,但代码语法必须严格符合Python标准。 - 确保正则表达式能够正确匹配日志中的空格和格式。 ## Triggers - 编写python脚本提取日志数据 - 解析婴儿护理日志 - 提取配方奶记录 - Piyo日志转JSON

What's inside
Steps it walks through
  1. Prompt
  2. Triggers
More from AutoSkill
All skills →
About this skill
What does the Python脚本解析婴儿护理日志提取配方奶记录 skill do?

编写Python脚本,从特定格式的婴儿护理日志(Piyo日志)中提取配方奶的时间和奶量,并输出为JSON数组。脚本需处理日期头和带时间戳的日志条目。

How do I install it?

Run `npx skills add ECNU-ICALK/AutoSkill --skill python脚本解析婴儿护理日志提取配方奶记录 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going