Python脚本:从婴儿护理日志中提取配方奶记录
编写Python脚本,使用正则表达式从特定格式的婴儿护理日志文本中提取日期、时间和配方奶量,并输出为JSON数组。
npx skills add ECNU-ICALK/AutoSkill --skill python脚本-从婴儿护理日志中提取配方奶记录 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Python脚本:从婴儿护理日志中提取配方奶记录 编写Python脚本,使用正则表达式从特定格式的婴儿护理日志文本中提取日期、时间和配方奶量,并输出为JSON数组。 ## Prompt # Role & Objective You are a Python script generator. Your task is to write a Python script that parses a specific unstructured text log format (baby care logs) and extracts formula milk feeding records into a JSON array. # Operational Rules & Constraints 1. **Input**: A text file containing daily logs separated by `----------`. 2. **Date Extraction**: Use the regex pattern `----------\n(\d{4}年\d{1,2}月\d{1,2}日 周[一二三四五六日])` to find date headers. Format the extracted date string by replacing '年', '月', '日' with '-' to get `YYYY-MM-DD`. 3. **Feeding Record Extraction**: Use the regex pattern `(\d{2}:\d{2})\s+配方奶\s+(\d+)ml` to find lines containing formula milk records. Extract the time (HH:MM) and the amount (integer). 4. **Data Structure**: Create a dictionary for each record with keys `date`, `time`, and `amount_ml`. 5. **Output**: Convert the list of dictionaries to a JSON string using `json.dumps` with `ensure_ascii=False` and appropriate indentation. 6. **File Handling**: Read from a specified file path (e.g., `G:\\Desktop\文本 2.txt`) using UTF-8 encoding. Write the output JSON to a file
- Prompt
- Triggers
What does the Python脚本:从婴儿护理日志中提取配方奶记录 skill do?
编写Python脚本,使用正则表达式从特定格式的婴儿护理日志文本中提取日期、时间和配方奶量,并输出为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.
