1.0.0 • Published 6 months ago

notion-lunar-birthday v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

Notion 农历生日转换工具

这个工具可以自动将 Notion 数据库中的阳历生日转换为农历日期,并计算下一个农历生日。

安装

全局安装

npm install -g notion-lunar-birthday

本地安装

  1. 克隆仓库:
git clone [repository-url]
cd notion-lunar-birthday
  1. 安装依赖:
npm install

配置

有两种方式配置 Notion API 密钥和数据库 ID:

方式一:配置文件

  1. 在用户主目录创建配置文件:
cp config-template.json ~/.notion-lunar-config.json
  1. 编辑配置文件,填入你的 Notion API 密钥和数据库 ID:
{
  "NOTION_API_KEY": "your-api-key-here",
  "NOTION_DATABASE_ID": "your-database-id-here"
}

方式二:命令行参数

直接在命令行中提供参数:

update-lunar --key your-api-key --database your-database-id

使用方法

  1. 确保你的 Notion 数据库中有以下属性:

    • 生日(Date 类型)
    • 名称(Title 类型)
    • 农历生日(Rich text 类型,程序会自动创建)
    • 下一个农历生日(Date 类型,程序会自动创建)
  2. 运行程序:

update-lunar

程序会自动:

  • 将阳历生日转换为农历日期
  • 计算下一个农历生日的日期
  • 更新数据库中的相关字段

注意事项

  1. 需要给你的 Notion 集成授予数据库的访问权限
  2. 每次修改生日后需要重新运行程序更新农历信息
  3. 建议将生日历法设置为"阳历"或"农历"来区分使用哪种历法计算提醒