Go to file
2023-05-15 01:58:42 +08:00
.github/workflows chore: move python code to /scripts 2022-12-09 16:52:02 +08:00
scripts fix: follow site dom change 2023-05-15 01:58:42 +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 chore: regenerate all ics files 2021-11-06 00:11:40 +08:00
2007.json feat: add json schema 2019-09-11 22:42:42 +08:00
2008.ics chore: regenerate all ics files 2021-11-06 00:11:40 +08:00
2008.json feat: add json schema 2019-09-11 22:42:42 +08:00
2009.ics chore: regenerate all ics files 2021-11-06 00:11:40 +08:00
2009.json feat: add json schema 2019-09-11 22:42:42 +08:00
2010.ics chore: regenerate all ics files 2021-11-06 00:11:40 +08:00
2010.json feat: add json schema 2019-09-11 22:42:42 +08:00
2011.ics chore(release): update holiday data 2022-02-26 16:50:07 +08:00
2011.json chore(release): update holiday data 2022-02-26 16:50:07 +08:00
2012.ics chore: regenerate all ics files 2021-11-06 00:11:40 +08:00
2012.json feat: add json schema 2019-09-11 22:42:42 +08:00
2013.ics chore: regenerate all ics files 2021-11-06 00:11:40 +08:00
2013.json feat: add json schema 2019-09-11 22:42:42 +08:00
2014.ics chore: regenerate all ics files 2021-11-06 00:11:40 +08:00
2014.json feat: add json schema 2019-09-11 22:42:42 +08:00
2015.ics chore: regenerate all ics files 2021-11-06 00:11:40 +08:00
2015.json Update holiday data [skip ci] 2021-09-22 19:33:26 +08:00
2016.ics chore: regenerate all ics files 2021-11-06 00:11:40 +08:00
2016.json feat: add json schema 2019-09-11 22:42:42 +08:00
2017.ics chore: regenerate all ics files 2021-11-06 00:11:40 +08:00
2017.json feat: add json schema 2019-09-11 22:42:42 +08:00
2018.ics chore: regenerate all ics files 2021-11-06 00:11:40 +08:00
2018.json feat: add json schema 2019-09-11 22:42:42 +08:00
2019.ics chore: regenerate all ics files 2021-11-06 00:11:40 +08:00
2019.json Update holiday data [skip ci] 2021-09-22 19:33:26 +08:00
2020.ics fix: unexpected data file change 2022-04-22 15:19:08 +08:00
2020.json fix: unexpected data file change 2022-04-22 15:19:08 +08:00
2021.ics Update holiday data [skip ci] 2021-11-04 03:35:10 +00:00
2021.json revert: "Update holiday data [skip ci]" 2021-09-24 20:15:18 +08:00
2022.ics Update holiday data [skip ci] 2021-11-04 03:35:10 +00:00
2022.json Update holiday data [skip ci] 2021-10-25 16:28:23 +00:00
2023.ics chore(release): update holiday data 2022-12-09 03:10:31 +00:00
2023.json chore(release): update holiday data 2022-12-09 03:10:31 +00:00
2024.ics chore(release): update holiday data 2023-01-01 12:12:54 +00:00
2024.json chore(release): update holiday data 2023-01-01 12:12:54 +00:00
dev-requirements.txt chore(deps): update dependency requests to v2.30.0 2023-05-04 17:58:06 +00:00
holiday-cn.ics chore(release): update holiday data 2023-01-01 12:12:54 +00:00
LICENSE Initial commit 2019-03-05 10:56:09 +08:00
Makefile chore: move python code to /scripts 2022-12-09 16:52:02 +08:00
README.md docs: update stale badge 2023-01-03 12:42:12 +08:00
renovate.json chore: modify renovate.json 2019-04-28 20:49:31 +08:00
schema.json chore: update json schema 2019-09-11 23:00:55 +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

或使用 JSDelivr

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

也可尝试使用 ghproxy 或其他 Github 加速:

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

访问 github 不方便时可使用国内镜像仓库 2022-08-05: coding 现在要求登录才能下载开源仓库的文件。

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

ICalendar 订阅

网址格式参见上一节

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

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

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

作为 git 子模块使用

参见 Git 工具 - 子模块