tessl install tessl/pypi-lunar-python@1.4.0Comprehensive Chinese lunar calendar library with Solar calendar conversion and traditional Chinese calendar features.
Agent Success
Agent success rate when using this tile
79%
Improvement
Agent success rate improvement when using this tile compared to baseline
0.9x
Baseline
Agent success rate without this tile
88%
Build a utility that reports Chinese seasonal tradition details for a given Gregorian date, covering winter counting, dog days, pentad phrases, and the moon phase in one normalized response.
2021-12-21, the winter counting status reports period name 一九 and day index 1, while summer dog days are absent. @test2020-08-24, the dog-days status reports period name 末伏 and day index 10, with no winter counting period. @test2020-04-23, the pentad description corresponds to 萍始生, with no winter or dog-day periods present. @test2021-05-26, the moon phase description is 望 (full moon), and other seasonal fields remain unset when not applicable. @test@generates
from typing import Optional, TypedDict
class TraditionInfo(TypedDict):
name: str # Human-readable period label such as 一九 or 末伏
day_index: int # 1-based index within the current period
class TraditionReport(TypedDict):
date: str
shujiu: Optional[TraditionInfo]
fu: Optional[TraditionInfo]
wuhou: Optional[str]
yuexiang: str
def describe_traditions(date_str: str) -> TraditionReport:
"""
Returns normalized seasonal tradition details for an ISO date (YYYY-MM-DD).
ShuJiu and Fu are null when out of range; WuHou is null when unavailable.
"""Chinese lunisolar calendar library providing ShuJiu, Fu, WuHou, and moon-phase calculations.