Initial commit: Lunar calendar converter project

- Add lunar calendar astronomical calculation engine (lunar_calendar.py)
- Add converter utilities for solar/lunar date conversion
- Add historical era name conversions (chrono_converter.py, converter_with_eras.py)
- Add FastAPI REST API for date conversion services
- Add age calculator using lunar calendar
- Add batch generation script for lunar calendar JSON data
- Add project documentation (CLAUDE.md, pyproject.toml)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-09 13:51:45 +08:00
commit d788399b3a
20 changed files with 2202 additions and 0 deletions

33
ruff.toml Normal file
View File

@@ -0,0 +1,33 @@
line-length = 100
target-version = "py310"
# 忽略常見產物與虛擬環境資料夾
extend-exclude = [
".venv",
"venv",
".tox",
".mypy_cache",
".pytest_cache",
".ruff_cache",
"build",
"dist",
"node_modules",
]
[lint]
# 基本錯誤/風格 + 匯入排序 + pyupgrade + bugbear
select = ["E", "F", "I", "UP", "B"]
# 允許自動修復所有可修復項目VS Code 會透過 Code Action 觸發)
fixable = ["ALL"]
[lint.isort]
# 預設與 Black 兼容的行為已良好,一般無需額外調整
[format]
# 格式器偏好VS Code 也設定了 LF 與 ruler 88
quote-style = "double" # 可選:"single" | "double" | "preserve"
indent-style = "space" # 可選:"space" | "tab"
line-ending = "lf" # 可選:"lf" | "cr-lf" | "auto"
# 若文件含有 docstring 內嵌程式碼,可一併格式化
docstring-code-format = true
docstring-code-line-length = 100