Open-source project
NateScarlet/holiday-cn avatar
NateScarlet/holiday-cn

holiday-cn publishes China's public holidays as one JSON and ICS file per year

Chinese public holiday data, automatically scraped daily from State Council announcements.

2,296 stars228 forksPythonMIT

At a glance

What is it?
holiday-cn scrapes State Council announcements every day and commits the result as static files. Its limits are in the data model: papers are filed by title year, and weekend rest days are left out.
Who is it for?
Use holiday-cn if your app needs Chinese statutory holidays and make-up workdays as plain files you can fetch, vendor or subscribe to in a calendar. Do not point production traffic at raw.githubusercontent.com or a CDN without a fallback, since the README itself warns that third parties fail.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 2 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 23, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • NateScarlet/holiday-cn2,296 ★ · +93
Star history
Repository2026-10-082026-11-23
NateScarlet/holiday-cn2.2k2.3k

93 Stars in the last 46 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

One file per year, built from State Council announcements

The repository root is a long run of paired files, 2007.json and 2007.ics up through 2027.json and 2027.ics, plus holiday-cn.ics and a schema.json. Each year has its own JSON file and its own calendar file. There is no server, no API key and no query language. You request a file by year and read it.

The data comes from China's State Council. The README describes it as Chinese statutory holiday data scraped automatically every day from State Council announcements. A CI job updates the files, and when the data changes it publishes a new release. The README suggests choosing Watch and then Release only on GitHub if you want an email when that happens. Those releases also carry a JSON bundle that you can download from the releases page.

The JSON shape is a year, a list of source papers and a list of days

The README gives the format as a TypeScript interface and points to schema.json for the JSON Schema:

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

year is a full integer year. papers holds the web addresses of the State Council documents used. Each entry in days has a holiday name, an ISO 8601 date and an isOffDay boolean. The boolean is the field most consumers care about: a day with isOffDay set to true is a rest day, and the README documents the field only as whether the day is a rest day, so read the data for how work days are encoded.

Years follow the paper's title, so December can belong to next year's file

The first note in the README is the one most likely to cause a bug. The year in each file follows the year in the State Council document's title, not the year of the dates. A date in December can therefore be affected by the next year's document, and the README tells you to check two files. If you look up 2026-12-31 and read only 2026.json, you may miss a rule that sits in the 2027 file.

In practice that means a lookup function should open the file for the date's year and the file for the following year, then merge. The repository already has 2027.json and 2027.ics, which makes the second lookup possible for late-2026 dates. The README does not say how a conflict between the two files is resolved, so the merge rule is yours to define.

Weekends joined to a holiday are not in the data

The second note covers the phrase 与周末连休, which refers to a holiday run that joins a weekend. That weekend is not a statutory holiday, so the data does not include it. The README cites the national regulation on annual festivals and memorial days, published on gov.cn, and two GitHub issues, #213 and #221.

The consequence is concrete. If you count days off by adding up entries in days, you will undercount any break that runs into a Saturday or Sunday. A calendar that must show the full time off needs your own logic that fills in weekends adjacent to a listed rest day. The data gives the official dates, and the weekends stay your job.

Fetching from GitHub, jsDelivr or a proxy, and why the README says to self-host

For use over the internet the README gives URL patterns with a year placeholder written in Chinese:

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

The jsDelivr form is `https://cdn.jsdelivr.net/gh/NateScarlet/holiday-cn@master/{年份}.json`, with a second host at `https://fastly.jsdelivr.net/gh/NateScarlet/holiday-cn@master/{年份}.json`. For readers who find GitHub hard to reach, the README suggests ghproxy or other GitHub accelerators. A former Chinese mirror on coding.net is struck through, with a note dated 2022-08-05 that Coding now requires a login to download files from open-source repositories.

The README opens this section with a warning: any third-party service may fail or stop, so if you need high stability, run your own static file server. Every URL above is a third party except a server you operate. The README also describes using the repository as a git submodule and links the git documentation for it.

ICS subscriptions come in a yearly file and a rolling window

Calendar users get two kinds of file. A file named after the year, such as 2026.ics, holds that year's holidays. holiday-cn.ics covers the span from three years ago to the next year. The URL format is the same as for JSON, so a calendar app can subscribe directly to the raw or CDN address.

The README credits @retanoj for the ICS conversion. It does not state how subscription clients refresh, so how soon a change in the State Council notice reaches your calendar depends on your client's polling and on the CDN cache. The README makes no promise about delay.

Releases are CalVer, and the latest tag is older than the last push

The README carries a CalVer badge, and the release names match: 2026.01.01, 2025.11.04 and 2025.05.08. The README says a release is published when the data changes. The most recent release is dated 2026-01-01, and the last push to the repository was on 2026-10-23. The repository is not archived and the license is MIT.

For contributors, the Makefile defines lint, format and test targets that run black with the py312 target and pytest, and the repository includes a dev-requirements.txt. The README itself gives no instructions on running the scraper, so reading the scripts directory is the way to see how announcements become files.

Editorial conclusion

Use holiday-cn if your app needs Chinese statutory holidays and make-up workdays as plain files you can fetch, vendor or subscribe to in a calendar. Do not point production traffic at raw.githubusercontent.com or a CDN without a fallback, since the README itself warns that third parties fail. Before shipping, check that your date logic reads two yearly files around December and January, and that you do not treat a weekend inside a holiday run as a listed day.

Frequently asked questions

Where does holiday-cn get its data?

It scrapes State Council announcements automatically every day. Each yearly JSON file lists the State Council document addresses it used in a papers field.

Why do I need to check two yearly files near December?

The year in each file follows the year in the State Council document title, not the dates. A December date can be affected by the next year's document, so the README says to check both files.

Does holiday-cn include the weekend next to a holiday?

No. A weekend joined to a holiday run is not a statutory holiday, so the data does not contain it.

Can I subscribe to holiday-cn in a calendar app?

Yes. Use the yearly .ics file, or holiday-cn.ics, which covers three years back to the next year. The URL format matches the JSON files.

Official sources

  1. Issues
  2. License: MIT
  3. NateScarlet/holiday-cn on GitHub
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/natescarlet-holiday-cn.svg)](https://hysenlabs.com/projects/natescarlet-holiday-cn)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/natescarlet-holiday-cn.svg)](https://hysenlabs.com/projects/natescarlet-holiday-cn)

Was this useful?