How manche123/solar-lunar-converter works
Project Type and Purpose
• This is an open-source, Python-based Solar-Lunar calendar conversion tool.
• It exposes its core logic as a library (accurate_lunar_converter.py) and provides two CLI front-ends: interactive_converter.py (interactive shell) and example.py (scripted usage).
• Its primary function is to convert a datetime object into detailed lunar calendar data (干支, 节气, 闰月, 时辰) by leveraging the external zhdate library.
File-Structure Analysis
Top-level files:
• .gitignore
• README.md
• requirements.txt
• accurate_lunar_converter.py ← core library
• example.py ← example script showing library usage
• interactive_converter.py ← CLI interactive tool
Patterns/Implications:
• Single-module library + two CLI wrappers
• Dependencies declared in requirements.txt (zhdate)
• No separate “backend” or “frontend” directories—this is a utility library with CLI interfaces.
Key README Insights
• Describes functional scope: conversion, 干支 calculations, 节气判断, 闰月处理, 时辰转换
• Mentions using zhdate for accuracy
• Lists input/output formats and usage examples
• Notes possible extension points (e.g., more precise astronomical algorithms)