|
|
||
|---|---|---|
| .github/workflows | ||
| tests | ||
| .coveragerc | ||
| .gitignore | ||
| 2007.json | ||
| 2008.json | ||
| 2009.json | ||
| 2010.json | ||
| 2011.json | ||
| 2012.json | ||
| 2013.json | ||
| 2014.json | ||
| 2015.json | ||
| 2016.json | ||
| 2017.json | ||
| 2018.json | ||
| 2019.json | ||
| 2020.json | ||
| 2021.json | ||
| 2022.json | ||
| dev-requirements.txt | ||
| fetch_holidays.py | ||
| LICENSE | ||
| README.md | ||
| renovate.json | ||
| requirements.txt | ||
| schema.json | ||
| update.py | ||
holiday-cn
中国法定节假日数据 自动每日抓取国务院公告
- 提供 JSON 格式节假日数据
- CI 自动更新
- 数据变化时自动发布新版本 (
Watch-Release only以获取邮件提醒! ) - 发布页面提供 JSON 打包下载
数据格式:
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/{年份}.json
作为 git 子模块使用
参见 Git 工具 - 子模块