schedule-constraint-parsing
Uses regular expressions to parse dates, time ranges, and durations from natural language text like meeting requests.
- License 许可
- MIT
- 最近更新
- 2026-10-02
- Stars
- ★ 93
- Forks
- 8
01 前言 Front Matter
- name
- schedule-constraint-parsing
- description
- Uses regular expressions to parse dates, time ranges, and durations from natural language text like meeting requests.
03 SKILL.md 正文
Schedule Constraint Parsing
This skill outlines how to use standard Python re and datetime libraries to extract specific meeting requirements (duration, dates, start/end time windows) from email bodies.
Common Regex Patterns
1. Extracting Duration
People describe duration in hours or minutes (e.g., "1.5 hour", "one-hour", "45-minute").
import re
def parse_duration(text):
duration_min = None
# Hour pattern
hr_match = re.search(r'([\d\.]+|(?:one|two|three|half))\s*(?:hour|hr)', text, re.IGNORECASE)
if hr_match:
val = hr_match.group(1).lower()
if val == 'one': hours = 1.0
elif val == 'two': hours = 2.0
elif val == 'half': hours = 0.5
else: hours = float(val)
duration_min = int(hours * 60)
# Minute pattern
min_match = re.search(r'(\d+)\s*(?:minute|min)', text, re.IGNORECASE)
if min_match:
duration_min = int(min_match.group(1))
return duration_min
2. Extracting Time Range
Extracting available start and end boundaries (e.g., "between 10:00am to 2:00pm", "between 1:00 PM and 5:00 PM PST").
def parse_time_window(text):
# Extracts HH:MM AM/PM pairs
pattern = r'(\d{1,2}(?::\d{2})?\s*(?:am|pm|AM|PM)).*?(?:to|and|-)\s*(\d{1,2}(?::\d{2})?\s*(?:am|pm|AM|PM))'
match = re.search(pattern, text)
if match:
start_time_str = match.group(1)
end_time_str = match.group(2)
return start_time_str, end_time_str
return None, None
These simple extraction functions are excellent bases for parsing natural language scheduling intents.
04 同仓库更多 Skills
object_counter
Count occurrences of an object in the image using computer vision algorithm.
travel-planning-workflow
Invoke this skill when performing travel planning. It defines a structured workflow for generating itineraries. Following this workflow is essential to ensure the final plan satisfies user requirements.
bundled-dataset-search-tool
invoke this skill when you need to perform database search for travel planning. This skill provides some useful pre-packaged tools to look up accommodations, attractions, cities, driving distance, flights, and restaurants from the bundled dataset.
glm-output
Output-processing guidance for GLM tasks. Especially useful after glm-basics and glm-calibration when you need verifier-matching metrics from output.nc and a final /root/metrics.json.
glm-calibration
Calibration guidance for GLM tasks. Often most effective after glm-basics has clarified the setup; glm-output is the companion skill for exact final metric computation.
glm-basics
A good starting point for GLM calibration tasks. Use to inspect glm3.nml, confirm how GLM runs, and identify the relevant files before moving on to calibration and output evaluation.