run2_pdf-calendar-parsing
Precisely parse a PDF day-view calendar to extract event times, durations, and colors by reading visual block positions and the 15-minute grid.
- License 许可
- MIT
- 最近更新
- 2026-10-02
- Stars
- ★ 93
- Forks
- 8
01 前言 Front Matter
- name
- run2_pdf-calendar-parsing
- description
- Precisely parse a PDF day-view calendar to extract event times, durations, and colors by reading visual block positions and the 15-minute grid.
03 SKILL.md 正文
PDF Calendar Parsing (Improved)
Grid Structure
- Each hour label (12am, 1am, …, 11pm) marks the TOP of that hour's row
- Between two adjacent dashed horizontal lines = 15 minutes
- 4 intervals per hour
Reading Block Times — Step by Step
- Find the hour label closest ABOVE the block's top edge
- Count how many 15-min ticks down from that label to the block's top → start time
- Find the hour label closest ABOVE the block's bottom edge
- Count ticks to block bottom → end time
- If a block starts exactly at a label, start = that label's time on the dot
Color Classification
| Color | Hex range (approx) | Status |
|---|---|---|
| Dark gray | R<100, G<100, B<100 | Busy (OOO) |
| Red/salmon | R>200, G<150, B<150 | Busy |
| Blue/purple | R~130, G~130, B~200-230 | Available (overwritable) |
| Lime/yellow-green | R>150, G>180, B<100 | Busy |
Example Calendar — March 9, 2026
12:00 AM – 08:00 AM Out of office (gray) BUSY
08:00 AM – 10:00 AM [empty] FREE
10:00 AM – 11:00 AM Weekly Group Meeting (red) BUSY
11:00 AM – 12:00 PM Busy with task B (BLUE) FREE (overwritable)
12:00 PM – 02:00 PM [empty] FREE
02:00 PM – 03:00 PM Project A Discussion (red) BUSY
03:00 PM – 03:15 PM Coffee Chat (lime) BUSY ← 1 tick = 15 min
03:15 PM – 06:00 PM [empty] FREE
06:00 PM – 12:00 AM Out of office (gray) BUSY
Thin Block Disambiguation
A block taking exactly ONE 15-min slot looks like a thin line just above a dashed separator.
- If the label is at 3pm and the block bottom aligns with the first dashed line below → 3:00–3:15
Python extraction with pdfplumber
import pdfplumber
with pdfplumber.open("calendar.pdf") as pdf:
text = pdf.pages[0].extract_text()
# Text output lists event names and time labels
# Visual block colors require image analysis
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.