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%
Generate a single-call description of a moment that blends Gregorian details with Chinese lunar calendar context for end users.
render_summary(datetime(2023, 5, 29, 13, 0)) yields:
Solar: 2023-05-29 13:00 Monday | Western zodiac: GeminiLunar: 癸卯年(兔) 丁巳月 癸酉日 己未时 | 农历: 四月十一 | 纳音: 金箔金/沙中土/剑锋金/天上火render_summary(datetime(2023, 4, 11, 13, 0), input_calendar="lunar") returns the same two-line text as the Gregorian input above.render_summary(datetime(2023, 5, 29, 13, 0), compact=True) returns 2023-05-29 13:00 Mon Gemini | 癸卯年(兔) 丁巳月 癸酉日 己未时 | 农历 四月十一 | 纳音 金箔金/沙中土/剑锋金/天上火.All summaries use zero-padded 24-hour times, English weekday names in full form for the two-line output and three-letter form for the compact line, and pipe separators surrounded by single spaces in the exact order shown in the examples.
@generates
from datetime import datetime
from typing import Literal
def render_summary(moment: datetime, *, input_calendar: Literal["solar", "lunar"] = "solar", compact: bool = False) -> str:
"""
Return a formatted description for the given moment.
moment is interpreted as Gregorian time when input_calendar="solar" and as a lunar date/time when input_calendar="lunar".
"""Provides lunar/solar conversion, cyclical stems/branches, NaYin, Chinese zodiac animals, weekday lookup, and Western zodiac lookup.