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:
10
.vscode/extensions.json
vendored
Normal file
10
.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
// 推薦安裝的擴充(可於側邊欄 Extensions 接受建議安裝)
|
||||
"recommendations": [
|
||||
"charliermarsh.ruff",
|
||||
"ms-python.python",
|
||||
"ms-python.vscode-pylance",
|
||||
"ms-toolsai.jupyter",
|
||||
"Natizyskunk.sftp"
|
||||
]
|
||||
}
|
||||
94
.vscode/settings.json
vendored
Normal file
94
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
{
|
||||
// ——— 工作區 VS Code 設定 ———
|
||||
// 需安裝擴充(建議):
|
||||
// 1) charliermarsh.ruff → Python 格式化 + 匯入排序 + Lint/修復
|
||||
// 2) ms-python.python → Python 語言支援、測試、偵錯、終端環境
|
||||
// 3) ms-python.vscode-pylance → 型別分析/智慧提示(使用 Pylance)
|
||||
// 4) ms-toolsai.jupyter →(可選)Notebook 支援
|
||||
// 也可直接接受工作區推薦(.vscode/extensions.json)
|
||||
|
||||
// 檔案總管把雜物藏起來,乾淨一點
|
||||
"files.exclude": {
|
||||
"**/.git": true,
|
||||
"**/.svn": true,
|
||||
"**/.hg": true,
|
||||
"**/CVS": true,
|
||||
"**/__pycache__": true,
|
||||
"**/.DS_Store": true
|
||||
},
|
||||
|
||||
// 不愛被一直彈參數提示,關掉就清爽
|
||||
"editor.parameterHints.enabled": false,
|
||||
|
||||
// 字型&連字:看起來順眼一點
|
||||
"editor.fontFamily": "JetBrainsMono Nerd Font Mono",
|
||||
"editor.fontLigatures": true,
|
||||
|
||||
// 介面縮放:0 就是原尺寸,自己再調
|
||||
"window.zoomLevel": 0,
|
||||
|
||||
// 存檔只格式化實際修改的區塊(減少整檔 diff)
|
||||
"editor.formatOnSaveMode": "modificationsIfAvailable",
|
||||
|
||||
// 若未安裝 Code Runner,避免未知設定警告:先移除相關設定
|
||||
|
||||
// 版面微調:全域用空白縮排,預設 2 格;換行一律 LF
|
||||
"editor.insertSpaces": true,
|
||||
"editor.tabSize": 2,
|
||||
"files.eol": "\n",
|
||||
"files.trimTrailingWhitespace": true,
|
||||
"files.insertFinalNewline": true,
|
||||
// 專案行寬 100 欄(與 Ruff 設定一致)
|
||||
"editor.rulers": [100],
|
||||
|
||||
// 使用 Ruff:Lint + 匯入排序 + 格式化(見 ruff.toml)
|
||||
|
||||
// Python 語言專屬設定
|
||||
"[python]": {
|
||||
// 以 Ruff 當預設格式器
|
||||
"editor.defaultFormatter": "charliermarsh.ruff",
|
||||
// 存檔:格式化 + 自動修復 + 匯入排序
|
||||
"editor.formatOnSave": true,
|
||||
// 交給 Ruff 做自動修復與匯入排序(避免與 isort 重疊)
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.ruff": "explicit",
|
||||
"source.organizeImports.ruff": "explicit"
|
||||
},
|
||||
// Python 習慣 4 空白縮排
|
||||
"editor.tabSize": 4
|
||||
},
|
||||
|
||||
// Pylance/分析:全專案診斷(型別等級改由 pyrightconfig.json 管理)
|
||||
"python.analysis.diagnosticMode": "workspace",
|
||||
"python.terminal.activateEnvironment": true,
|
||||
// 指定預設的工作區 Interpreter(本機虛擬環境)
|
||||
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
|
||||
// 若需調整 Pylance 型別檢查或診斷嚴重度,請至 pyrightconfig.json
|
||||
|
||||
// 測試(若使用 pytest):VS Code 直接偵測測試並執行
|
||||
"python.testing.pytestEnabled": true,
|
||||
"python.testing.unittestEnabled": false,
|
||||
"python.testing.pytestArgs": ["tests"],
|
||||
|
||||
// 搜尋/監控忽略更多常見產物與虛擬環境
|
||||
"search.exclude": {
|
||||
"**/node_modules": true,
|
||||
"**/bower_components": true,
|
||||
"**/.venv": true,
|
||||
"**/venv": true,
|
||||
"**/.tox": true,
|
||||
"**/.mypy_cache": true,
|
||||
"**/.pytest_cache": true,
|
||||
"**/.ruff_cache": true,
|
||||
"**/dist": true,
|
||||
"**/build": true
|
||||
},
|
||||
"search.useIgnoreFiles": true,
|
||||
"files.watcherExclude": {
|
||||
"**/node_modules/**": true,
|
||||
"**/.venv/**": true,
|
||||
"**/venv/**": true,
|
||||
"**/.tox/**": true,
|
||||
"**/.git/**": true
|
||||
}
|
||||
}
|
||||
57
.vscode/sftp.example.jsonc
vendored
Normal file
57
.vscode/sftp.example.jsonc
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
{
|
||||
// 提示:將本檔複製為 .vscode/sftp.json(純 JSON,勿含註解)後再編輯。
|
||||
|
||||
// 顯示用名稱(任意字串)
|
||||
"name": "My Server",
|
||||
|
||||
// 伺服器位址(IP 或 ~/.ssh/config 的 Host 別名)
|
||||
"host": "192.168.42.108",
|
||||
|
||||
// 傳輸協定:sftp(SSH 上的檔案傳輸)
|
||||
"protocol": "sftp",
|
||||
|
||||
// SSH 連線埠,預設 22
|
||||
"port": 22,
|
||||
|
||||
// 登入使用者(例:root)
|
||||
"username": "root",
|
||||
|
||||
// ——— 擇一方式(請只保留其中一種)———
|
||||
// A) 使用系統環境中的 ssh-agent(SSH_AUTH_SOCK)
|
||||
// "agent": "env",
|
||||
// B) 直接指定私鑰路徑(例如 ECDSA)
|
||||
"privateKeyPath": "~/.ssh/id_ecdsa",
|
||||
// 若金鑰有通關詞,請移除此欄並讓 agent 代為解鎖
|
||||
// "passphrase": "不建議填在設定檔",
|
||||
// 參考本機 SSH 設定(可選)
|
||||
"sshConfigPath": "~/.ssh/config",
|
||||
// 不回退互動式密碼驗證
|
||||
"interactiveAuth": false,
|
||||
|
||||
// ——— 可選:改用 OpenSSH 設定 ——
|
||||
// 若想完全沿用 ~/.ssh/config 與 multiplex,可改為:
|
||||
// "openSsh": true, 並刪除上方 agent/privateKeyPath 等欄位
|
||||
|
||||
// 遠端根目錄(所有上下載相對於此路徑)
|
||||
"remotePath": "/opt/lunar-converter",
|
||||
|
||||
// 存檔即自動上傳:true 開啟;若不想每次存檔都上傳,改為 false
|
||||
"uploadOnSave": true,
|
||||
|
||||
// 上傳時先用暫存檔再改名:false 直接覆寫;若遠端需要原子寫入可設 true
|
||||
"useTempFile": false,
|
||||
|
||||
// 忽略不需上傳的檔案/資料夾
|
||||
"ignore": [
|
||||
"**/.git/**",
|
||||
"**/.DS_Store",
|
||||
"**/node_modules/**",
|
||||
"**/.venv/**",
|
||||
"**/venv/**",
|
||||
"**/.mypy_cache/**",
|
||||
"**/.pytest_cache/**",
|
||||
"**/.ruff_cache/**",
|
||||
"**/dist/**",
|
||||
"**/build/**"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user