Go to file
2021-10-10 02:50:30 +08:00
.github/workflows ci: run linter 2021-10-10 02:22:34 +08:00
tests style: use black as formatter 2021-09-22 19:22:48 +08:00
.coveragerc Correct coveragerc 2019-03-12 23:07:53 +08:00
.gitignore Update .gitignore 2019-03-08 00:19:43 +08:00
2007.ics feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
2007.json feat: add json schema 2019-09-11 22:42:42 +08:00
2008.ics feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
2008.json feat: add json schema 2019-09-11 22:42:42 +08:00
2009.ics feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
2009.json feat: add json schema 2019-09-11 22:42:42 +08:00
2010.ics feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
2010.json feat: add json schema 2019-09-11 22:42:42 +08:00
2011.ics feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
2011.json feat: add json schema 2019-09-11 22:42:42 +08:00
2012.ics feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
2012.json feat: add json schema 2019-09-11 22:42:42 +08:00
2013.ics feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
2013.json feat: add json schema 2019-09-11 22:42:42 +08:00
2014.ics feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
2014.json feat: add json schema 2019-09-11 22:42:42 +08:00
2015.ics feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
2015.json Update holiday data [skip ci] 2021-09-22 19:33:26 +08:00
2016.ics feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
2016.json feat: add json schema 2019-09-11 22:42:42 +08:00
2017.ics feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
2017.json feat: add json schema 2019-09-11 22:42:42 +08:00
2018.ics feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
2018.json feat: add json schema 2019-09-11 22:42:42 +08:00
2019.ics feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
2019.json Update holiday data [skip ci] 2021-09-22 19:33:26 +08:00
2020.ics feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
2020.json Update holiday data [skip ci] 2020-09-07 14:35:29 +00:00
2021.ics feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
2021.json revert: "Update holiday data [skip ci]" 2021-09-24 20:15:18 +08:00
2022.ics feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
2022.json Update holiday data [skip ci] 2021-01-01 12:08:38 +00:00
dev-requirements.txt ci: run linter 2021-10-10 02:22:34 +08:00
fetch_holidays.py chore: change error message 2021-09-24 20:35:22 +08:00
generate_ics.py refactor: rename variable 2021-10-10 02:50:30 +08:00
holiday-cn.ics feat: rename ics file 2021-10-10 02:13:50 +08:00
LICENSE Initial commit 2019-03-05 10:56:09 +08:00
Makefile ci: run linter 2021-10-10 02:22:34 +08:00
README.md docs: add icalendar subscription 2021-10-10 02:36:32 +08:00
renovate.json chore: modify renovate.json 2019-04-28 20:49:31 +08:00
requirements.txt feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
schema.json chore: update json schema 2019-09-11 23:00:55 +08:00
update.py refactor: change generate_ics params 2021-10-10 02:44:44 +08:00

holiday-cn

Build Status Release CalVer Maintainability Test Coverage Maintenance

中国法定节假日数据 自动每日抓取国务院公告

  • 提供 JSON 格式节假日数据
  • CI 自动更新
  • 数据变化时自动发布新版本 ( Watch - Release only 以获取邮件提醒! )
  • 发布页面提供 JSON 打包下载

数据格式:

JSON Schema

interface Holidays {
  /** 完整年份, 整数。*/
  year: number;
  /** 所用国务院文件网址列表 */
  papers: string[];
  days: {
    /** 节日名称 */
    name: string;
    /** 日期, ISO 8601 格式 */
    date: string;
    /** 是否为休息日 */
    isOffDay: boolean;
  }[]
}

注意事项

  • 年份是按照国务院文件标题年份而不是日期年份12 月份的日期可能会被下一年的文件影响,因此应检查两个文件。

通过互联网使用

数据地址格式:

https://raw.githubusercontent.com/NateScarlet/holiday-cn/master/{年份}.json

访问 github 不方便时可使用国内镜像仓库

https://natescarlet.coding.net/p/github/d/holiday-cn/git/raw/master/{年份}.json

或使用 JSDelivr

https://cdn.jsdelivr.net/gh/NateScarlet/holiday-cn@master/{年份}.json

ICalendar 订阅

网址格式参见上一节

{年份}.ics 为对应年份的节假日

holiday-cn.ics 为 3 年前至次年的节假日

感谢 @retanoj 的 ics 格式转换实现

作为 git 子模块使用

参见 Git 工具 - 子模块