Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

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

ASecurity

编写Python脚本,使用正则表达式从特定格式的婴儿护理日志文本中提取日期、时间和配方奶量,并输出为JSON数组。

2 stars
0 votes
0 copies
0 views
Added 9/27/2026
toolspython

Security Analysis

A100/100

Scanned 9/27/2026

$npx -y skills add David-Li0406/meta-skill-evloving --skill 'python脚本-从婴儿护理日志中提取配方奶记录' --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Python脚本 从婴儿护理日志中提取配方奶记录?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Python脚本 从婴儿护理日志中提取配方奶记录
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-python-e1bc6000/badge)](https://www.skillsdirectory.com/skills/david-li0406-python-e1bc6000)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
id: "fba67f76-48e6-4f71-8a2f-9091209ddba8"
name: "Python脚本:从婴儿护理日志中提取配方奶记录"
description: "编写Python脚本,使用正则表达式从特定格式的婴儿护理日志文本中提取日期、时间和配方奶量,并输出为JSON数组。"
version: "0.1.0"
tags:
  - "Python"
  - "文本处理"
  - "正则表达式"
  - "数据提取"
  - "JSON"
  - "日志解析"
triggers:
  - "提取日志中的配方奶数据"
  - "编写脚本解析婴儿日志"
  - "将日志转换为JSON"
  - "正则提取喂奶记录"
  - "Python处理文本日志"
---

# 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 (e.g., `G:\\Desktop\baby_formula_feedings.json`).
7. **Code Style**: Use English double quotes (`"`) for strings in the Python script.

# Anti-Patterns
- Do not extract other events like sleep, urine, or stool unless explicitly requested.
- Do not use Chinese quotes in the Python code.
- Do not assume the file path; use a variable or the specific path requested by the user.

# Interaction Workflow
1. Define the regex patterns.
2. Open and read the file line by line.
3. Update the current date when a date header is matched.
4. When a feeding record is matched, create a record object and append it to the list.
5. After processing, write the list to a JSON file.

## Triggers

- 提取日志中的配方奶数据
- 编写脚本解析婴儿日志
- 将日志转换为JSON
- 正则提取喂奶记录
- Python处理文本日志

Attribution

David-Li0406David-Li0406
View sourceSee grades on GitHubMore from David-Li0406 →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

ucoz-landing-skill

Create and edit uCoz homepage landing pages via MCP: custom templates, hero sections, lead forms, navigation menus, SEO, and responsive layout. Includes a visual design system (style selection, layout/grid, section recipes, typography/spacing, color tokens, component states, icons, modern CSS/JS, motion, imagery, social proof, copy/voice, accessibility). Uses ucoz-mcp tools for templates, site file uploads, and site modules.

107 votes

Paperclip

Interact with the Paperclip control plane API for task coordination and governance. Use when checking assignments, updating issue status, posting comments, delegating work, managing routines, or calling Paperclip API endpoints.

953191 votes

Pptx

Presentation toolkit (.pptx). Create/edit slides, layouts, content, speaker notes, comments, for programmatic presentation creation and modification.

471861 votes

Daw Music

Digital Audio Workstation usage, music composition, interactive music systems, and game audio implementation for immersive soundscapes.

761 votes

Instantly Rdsthomas Mission Control

Instantly.ai cold email outreach API - manage campaigns, leads, accounts, and analytics. Use for cold email automation, lead management, campaign creation/monitoring, and email account warmup.

761 votes
View all in tools →