Skip to content
dsh.fish
Bundle

xby-lunar-calendar

一个基于Python 3.12和lunar-python的中国传统农历日历功能服务器,提供八字计算、日历转换、黄历查询等功能。

Source
xby-skill
License
MIT
Updated
Updated 7 days ago

Readme

# xby-lunar-calendar

DeepSeek Harness (DSH) 的插件:农历日历服务

一个基于Python 3.12和lunar-python的中国传统农历日历功能服务器,提供八字计算、日历转换、黄历查询等功能。

## 功能

- **set_xby_apikey** — 在聊天中设置 API 密钥(自动持久化,重启有效)
- **bazi_calculate** — 
Calculate BaZi (Eight Characters) for fortune telling / 计算生辰八字用于算命

Args:
    birth_date: Birth date in YYYY-MM-DD format / 出生日期,格式YYYY-MM-DD
    birth_time: Birth time in HH:MM format / 出生时间,格式HH:MM

Returns:
    Detailed BaZi calculation result / 详细的八字计算结果

- **calendar_convert** — 
Convert between solar and lunar calendar / 公历农历互转

Args:
    date: Date in YYYY-MM-DD format / 日期,格式YYYY-MM-DD
    convert_to: Convert to "lunar" or "solar" / 转换为"lunar"或"solar"
    is_leap: Is leap month (only for lunar to solar conversion) / 是否闰月(仅用于农历转公历)

Returns:
    Calendar conversion result / 历法转换结果

- **huangli_query** — 
Query Chinese almanac (Huangli) for a specific date / 查询指定日期的黄历信息

Args:
    date: Date in YYYY-MM-DD format / 日期,格式YYYY-MM-DD

Returns:
    Detailed almanac information / 详细的黄历信息

- **fortune_daily** — 
Get daily fortune and recommendations / 获取每日运势和建议

Args:
    date: Date in YYYY-MM-DD format / 日期,格式YYYY-MM-DD

Returns:
    Daily fortune analysis / 每日运势分析

- **jieqi_query** — 
Query 24 solar terms (Jie Qi) for a year / 查询一年的二十四节气

Args:
    year: Year to query / 查询的年份

Returns:
    List of solar terms for the year / 该年的节气列表

- **wuxing_analyze** — 
Analyze Wu Xing (Five Elements) from birth info / 根据出生信息分析五行

Args:
    birth_date: Birth date in YYYY-MM-DD format / 出生日期,格式YYYY-MM-DD
    birth_time: Birth time in HH:MM format / 出生时间,格式HH:MM

Returns:
    Wu Xing analysis result / 五行分析结果


## 安装

### 方式一:从 GitHub 直接安装(推荐)

```bash
# 格式: dsh plugin --profile <profile> add github:<owner>/<repo>
dsh plugin --profile web add github:xby_skill/xby-lunar-calendar
```

### 方式二:从本地目录安装(开发模式)

```bash
# 仅用于本地开发调试
dsh plugin --profile web add /absolute/path/to/xby-lunar-calendar
```

### 方式三:通过 cordis.patch.yml 开发调试

```bash
dsh web --profile web --patch /absolute/path/to/dsh-ocr-plugin/cordis.patch.yml
```



## 配置

### 获取 API 密钥

前往 [小笨羊官网](https://xiaobenyang.com) 注册并获取 API 密钥。

Install

dsh plugin --profile web add github:xby-skill/xby-lunar-calendar

Profile: web

  • This package builds from source on install. pnpm will ask you to allow its build script — that is permission to run the package’s code on your machine, outside the agent sandbox. Only allow sources you trust.
  • This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.
Source