MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _parse_month

Function _parse_month

agents/wiki-agent/export/monthly_report.py:41–49  ·  view source on GitHub ↗
(value: Optional[str])

Source from the content-addressed store, hash-verified

39
40
41def _parse_month(value: Optional[str]) -> str:
42 text = _clean_text(value) or datetime.now().strftime("%Y-%m")
43 if not re.fullmatch(r"\d{4}-\d{2}", text):
44 raise ValueError("month must use YYYY-MM format, for example 2026-05")
45 year, month = text.split("-")
46 number = int(month)
47 if number < 1 or number > 12:
48 raise ValueError("month must be between 01 and 12")
49 return f"{int(year):04d}-{number:02d}"
50
51
52def _month_label(month: str) -> str:

Callers 1

export_monthly_reportFunction · 0.85

Calls 2

nowMethod · 0.80
_clean_textFunction · 0.70

Tested by

no test coverage detected