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

renovate[bot] 8f17936b5e chore(deps): update dependency python to 3.14 (#299) 2 gün önce
.github 8f17936b5e chore(deps): update dependency python to 3.14 (#299) 2 gün önce
scripts 5046df59ec test: update years in description_parsing_cases.json (#244) 11 ay önce
.coveragerc 33a4be8699 Correct coveragerc 6 yıl önce
.gitignore 7a2d9af66e Update .gitignore 6 yıl önce
2007.ics 0c2759c89d chore(deps): update dependency icalendar to v6.0.1 11 ay önce
2007.json c7dc8a194e chore(release): update holiday data 2 yıl önce
2008.ics 0c2759c89d chore(deps): update dependency icalendar to v6.0.1 11 ay önce
2008.json c7dc8a194e chore(release): update holiday data 2 yıl önce
2009.ics 0c2759c89d chore(deps): update dependency icalendar to v6.0.1 11 ay önce
2009.json c7dc8a194e chore(release): update holiday data 2 yıl önce
2010.ics 0c2759c89d chore(deps): update dependency icalendar to v6.0.1 11 ay önce
2010.json c7dc8a194e chore(release): update holiday data 2 yıl önce
2011.ics 0c2759c89d chore(deps): update dependency icalendar to v6.0.1 11 ay önce
2011.json c7dc8a194e chore(release): update holiday data 2 yıl önce
2012.ics 0c2759c89d chore(deps): update dependency icalendar to v6.0.1 11 ay önce
2012.json c7dc8a194e chore(release): update holiday data 2 yıl önce
2013.ics 0c2759c89d chore(deps): update dependency icalendar to v6.0.1 11 ay önce
2013.json c7dc8a194e chore(release): update holiday data 2 yıl önce
2014.ics 0c2759c89d chore(deps): update dependency icalendar to v6.0.1 11 ay önce
2014.json c7dc8a194e chore(release): update holiday data 2 yıl önce
2015.ics 0c2759c89d chore(deps): update dependency icalendar to v6.0.1 11 ay önce
2015.json c7dc8a194e chore(release): update holiday data 2 yıl önce
2016.ics 0c2759c89d chore(deps): update dependency icalendar to v6.0.1 11 ay önce
2016.json c7dc8a194e chore(release): update holiday data 2 yıl önce
2017.ics 0c2759c89d chore(deps): update dependency icalendar to v6.0.1 11 ay önce
2017.json c7dc8a194e chore(release): update holiday data 2 yıl önce
2018.ics 0c2759c89d chore(deps): update dependency icalendar to v6.0.1 11 ay önce
2018.json c7dc8a194e chore(release): update holiday data 2 yıl önce
2019.ics 0c2759c89d chore(deps): update dependency icalendar to v6.0.1 11 ay önce
2019.json c7dc8a194e chore(release): update holiday data 2 yıl önce
2020.ics 0c2759c89d chore(deps): update dependency icalendar to v6.0.1 11 ay önce
2020.json c7dc8a194e chore(release): update holiday data 2 yıl önce
2021.ics 0c2759c89d chore(deps): update dependency icalendar to v6.0.1 11 ay önce
2021.json c7dc8a194e chore(release): update holiday data 2 yıl önce
2022.ics 0c2759c89d chore(deps): update dependency icalendar to v6.0.1 11 ay önce
2022.json c7dc8a194e chore(release): update holiday data 2 yıl önce
2023.ics 0c2759c89d chore(deps): update dependency icalendar to v6.0.1 11 ay önce
2023.json c7dc8a194e chore(release): update holiday data 2 yıl önce
2024.ics 0c2759c89d chore(deps): update dependency icalendar to v6.0.1 11 ay önce
2024.json b00e2d38a8 chore(release): update holiday data 2 yıl önce
2025.ics f011d27f32 chore(release): update holiday data 5 ay önce
2025.json 6d06f199f8 chore(release): update holiday data 11 ay önce
2026.ics f011d27f32 chore(release): update holiday data 5 ay önce
2026.json 82e0b0042e chore(release): update holiday data 9 ay önce
LICENSE 748decd373 Initial commit 6 yıl önce
Makefile 97434adcac chore(deps): update python to 3.12 11 ay önce
README.md 2162c0d46b docs: update maintenance year 7 ay önce
dev-requirements.txt 5cf39fda9a chore(deps): update dependency coverage to v7.11.0 (#300) 3 gün önce
holiday-cn.ics f011d27f32 chore(release): update holiday data 5 ay önce
renovate.json 1d5fb6465e chore: update renovate config 11 ay önce
schema.json 04f646bfdd chore: update json schema 6 yıl önce

README.md

holiday-cn

Build Status Release CalVer JSDelivr Maintenance

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

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

数据格式:

JSON Schema

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

注意事项

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

  • 与周末连休 的周末不是法定节假日,数据里不会包含,见《全国年节及纪念日放假办法》 #213 #221

通过互联网使用

提示:任何第三方服务都可能故障或停止服务,如果稳定性要求高请自己搭建静态文件服务。

数据地址格式:

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

或使用 JSDelivr:

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

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

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

https://{ghproxy服务}/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 工具 - 子模块