china-holidays
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese国家法定节假日查询
National Statutory Holiday Query
Obtain the national statutory holiday arrangement notice issued by the General Office of the State Council from the official website of the Chinese government (www.gov.cn).
使用场景
Usage Scenarios
- 查询某年的节假日放假安排
- 了解法定假日调休日期
- 获取春节、国庆等长假具体天数
- 确认是否需要补班调休
- Query the holiday arrangement of a specific year
- Learn about the work rescheduling dates of statutory holidays
- Get the specific duration of long holidays such as Spring Festival and National Day
- Confirm whether work rescheduling and make-up shifts are required
工作流程
Workflow
第 1 步:确认查询年份
Step 1: Confirm the query year
首先确认用户要查询的年份。如果用户未指定,默认使用当前年份。
First confirm the year the user wants to query. If the user does not specify, the current year is used by default.
第 2 步:获取节假日通知
Step 2: Obtain the holiday notice
运行脚本获取国务院办公厅发布的节假日安排通知:
bash
python scripts/fetch_holidays.py --year {年份}此脚本采用缓存优先策略:
- 优先读取本地缓存:检查 是否存在
assets/{年份}.md - 缓存命中:直接返回缓存的节假日数据(毫秒级响应)
- 缓存未命中:联网从政府网获取数据,并自动缓存到本地
预期输出: 国务院办公厅关于该年度部分节假日安排的通知全文(纯中文内容)
Run the script to obtain the holiday arrangement notice issued by the General Office of the State Council:
bash
python scripts/fetch_holidays.py --year {年份}This script adopts a cache-first strategy:
- Prioritize reading local cache: Check whether exists
assets/{年份}.md - Cache hit: Return the cached holiday data directly (millisecond-level response)
- Cache miss: Fetch data from the government website online and automatically cache it locally
Expected output: The full text of the notice of the General Office of the State Council on the arrangement of some holidays in the year (pure Chinese content)
强制刷新(可选)
Force Refresh (Optional)
如需强制从网络获取最新数据(忽略缓存),添加 参数:
--forcebash
python scripts/fetch_holidays.py --year {年份} --force触发场景: 当用户提到以下类似话术时,使用 参数:
--force- "重新从网络获取"
- "强制更新缓存"
- "刷新一下数据"
- "重新下载"
- "更新一下{年份}的缓存"
If you need to force the latest data to be fetched from the network (ignoring the cache), add the parameter:
--forcebash
python scripts/fetch_holidays.py --year {年份} --forceTrigger scenarios: Use the parameter when the user mentions the following similar statements:
--force- "Re-fetch from the network"
- "Force update cache"
- "Refresh the data"
- "Re-download"
- "Update the cache for {year}"
第 3 步:解析并输出节假日信息
Step 3: Parse and output holiday information
根据获取到的通知内容,按照用户要求整理输出:
标准输出格式:
【{年份}年国家法定节假日安排】
一、元旦:{具体日期}放假调休,共{天数}天。{调休说明}
二、春节:{具体日期}放假调休,共{天数}天。{调休说明}
三、清明节:{具体日期}放假调休,共{天数}天。{调休说明}
四、劳动节:{具体日期}放假调休,共{天数}天。{调休说明}
五、端午节:{具体日期}放假调休,共{天数}天。{调休说明}
六、中秋节:{具体日期}放假调休,共{天数}天。{调休说明}
七、国庆节:{具体日期}放假调休,共{天数}天。{调休说明}According to the obtained notice content, organize and output according to user requirements:
Standard output format:
【{年份}年国家法定节假日安排】
一、元旦:{具体日期}放假调休,共{天数}天。{调休说明}
二、春节:{具体日期}放假调休,共{天数}天。{调休说明}
三、清明节:{具体日期}放假调休,共{天数}天。{调休说明}
四、劳动节:{具体日期}放假调休,共{天数}天。{调休说明}
五、端午节:{具体日期}放假调休,共{天数}天。{调休说明}
六、中秋节:{具体日期}放假调休,共{天数}天。{调休说明}
七、国庆节:{具体日期}放假调休,共{天数}天。{调休说明}示例
Examples
示例 1:查询 2026 年节假日
Example 1: Query holidays for 2026
用户说: "帮我查一下 2026 年的节假日安排"
操作:
- 确认年份:2026
- 运行:
python scripts/fetch_holidays.py --year 2026 - 获取国务院办公厅通知内容
- 整理输出节假日安排
结果:
【2026 年国家法定节假日安排】
一、元旦:1 月 1 日(周四)至 3 日(周六)放假调休,共 3 天。1 月 4 日(周日)上班。
二、春节:2 月 15 日(农历腊月二十八、周日)至 23 日(农历正月初七、周一)放假调休,共 9 天。2 月 14 日(周六)、2 月 28 日(周六)上班。
三、清明节:4 月 4 日(周六)至 6 日(周一)放假,共 3 天。
四、劳动节:5 月 1 日(周五)至 5 日(周二)放假调休,共 5 天。5 月 9 日(周六)上班。
五、端午节:6 月 19 日(周五)至 21 日(周日)放假,共 3 天。
六、中秋节:9 月 25 日(周五)至 27 日(周日)放假,共 3 天。
七、国庆节:10 月 1 日(周四)至 7 日(周三)放假调休,共 7 天。9 月 20 日(周日)、10 月 10 日(周六)上班。说明: 脚本返回的是国务院办公厅通知原文。Agent 需要从中提取关键信息并整理输出:
- 默认情况:按上述标准格式整理输出
- 用户指定格式:如果用户主动提供了输出格式要求或指定了输出模板,按照用户给定的要求整理输出(如 JSON、表格、列表、简短回复等)
User says: "Help me check the holiday arrangement for 2026"
Operation:
- Confirm the year: 2026
- Run:
python scripts/fetch_holidays.py --year 2026 - Obtain the notice content of the General Office of the State Council
- Organize and output the holiday arrangement
Result:
【2026 年国家法定节假日安排】
一、元旦:1 月 1 日(周四)至 3 日(周六)放假调休,共 3 天。1 月 4 日(周日)上班。
二、春节:2 月 15 日(农历腊月二十八、周日)至 23 日(农历正月初七、周一)放假调休,共 9 天。2 月 14 日(周六)、2 月 28 日(周六)上班。
三、清明节:4 月 4 日(周六)至 6 日(周一)放假,共 3 天。
四、劳动节:5 月 1 日(周五)至 5 日(周二)放假调休,共 5 天。5 月 9 日(周六)上班。
五、端午节:6 月 19 日(周五)至 21 日(周日)放假,共 3 天。
六、中秋节:9 月 25 日(周五)至 27 日(周日)放假,共 3 天。
七、国庆节:10 月 1 日(周四)至 7 日(周三)放假调休,共 7 天。9 月 20 日(周日)、10 月 10 日(周六)上班。Note: The script returns the original text of the notice of the General Office of the State Council. The Agent needs to extract key information from it and organize the output:
- Default situation: Organize and output according to the above standard format
- User-specified format: If the user actively provides output format requirements or specifies an output template, organize the output according to the user's given requirements (such as JSON, table, list, short reply, etc.)
示例 2:查询当年节假日
Example 2: Query holidays for the current year
用户说: "今年放假怎么安排的?"
操作:
- 确认年份:当前年份(2026)
- 运行:
python scripts/fetch_holidays.py --year 2026 - 输出节假日安排
结果: 输出 2026 年全年节假日安排(格式同示例 1)
User says: "What is the holiday arrangement for this year?"
Operation:
- Confirm the year: current year (2026)
- Run:
python scripts/fetch_holidays.py --year 2026 - Output the holiday arrangement
Result: Output the full-year holiday arrangement for 2026 (the format is the same as Example 1)
示例 3:强制刷新缓存
Example 3: Force refresh cache
用户说: "重新从网络获取 2026 年的节假日数据"
操作:
- 确认年份:2026
- 运行:
python scripts/fetch_holidays.py --year 2026 --force - 脚本会忽略本地缓存,重新从政府网获取数据
预期输出:
bash
$ python scripts/fetch_holidays.py --year 2026 --force
正在从网络获取 2026 年节假日数据...
找到通知:https://www.gov.cn/gongbao/2025/issue_12406/202511/content_7048922.html
正在获取通知内容...
已缓存到:skills/china-holidays/assets/2026.mdUser says: "Re-fetch the 2026 holiday data from the network"
Operation:
- Confirm the year: 2026
- Run:
python scripts/fetch_holidays.py --year 2026 --force - The script will ignore the local cache and re-fetch data from the government website
Expected output:
bash
$ python scripts/fetch_holidays.py --year 2026 --force
正在从网络获取 2026 年节假日数据...
找到通知:https://www.gov.cn/gongbao/2025/issue_12406/202511/content_7048922.html
正在获取通知内容...
已缓存到:skills/china-holidays/assets/2026.md下方是通知原文内容
下方是通知原文内容
undefinedundefined示例 4:查询特定节日
Example 4: Query a specific festival
用户说: "2026 年春节放假几天?"
操作:
- 确认年份:2026
- 运行脚本获取数据
- 从返回内容中提取春节相关信息
输出示例:
2026 年春节放假安排:
2 月 15 日(农历腊月二十八、周日)至 23 日(农历正月初七、周一)放假调休,共 9 天。
2 月 14 日(周六)、2 月 28 日(周六)上班。User says: "How many days off for the Spring Festival in 2026?"
Operation:
- Confirm the year: 2026
- Run the script to obtain data
- Extract Spring Festival related information from the returned content
Output example:
2026 年春节放假安排:
2 月 15 日(农历腊月二十八、周日)至 23 日(农历正月初七、周一)放假调休,共 9 天。
2 月 14 日(周六)、2 月 28 日(周六)上班。示例 5:比较两年节假日安排
Example 5: Compare holiday arrangements of two years
用户说: "对比一下 2025 年和 2026 年春节放假有什么不同"
操作:
- 分别获取两年的节假日数据
- 运行:和
python scripts/fetch_holidays.py --year 2025python scripts/fetch_holidays.py --year 2026 - 提取春节相关信息进行对比
输出示例:
2025 年 vs 2026 年春节放假对比:
2025 年春节:1 月 28 日(除夕)至 2 月 4 日(初七)放假,共 8 天
2026 年春节:2 月 15 日(腊月二十八)至 23 日(初七)放假,共 9 天
差异:2026 年比 2025 年多放 1 天,且 2026 年包含腊月二十八User says: "Compare the differences between the Spring Festival holidays in 2025 and 2026"
Operation:
- Obtain holiday data for the two years respectively
- Run: and
python scripts/fetch_holidays.py --year 2025python scripts/fetch_holidays.py --year 2026 - Extract Spring Festival related information for comparison
Output example:
2025 年 vs 2026 年春节放假对比:
2025 年春节:1 月 28 日(除夕)至 2 月 4 日(初七)放假,共 8 天
2026 年春节:2 月 15 日(腊月二十八)至 23 日(初七)放假,共 9 天
差异:2026 年比 2025 年多放 1 天,且 2026 年包含腊月二十八示例 6:自定义输出格式
Example 6: Custom output format
用户说: "用 JSON 格式输出 2026 年所有节假日安排"
操作:
- 运行脚本获取数据
- 按用户要求的 JSON 格式整理输出
输出示例:
json
{
"year": 2026,
"holidays": [
{"name": "元旦", "dates": "1 月 1 日 -1 月 3 日", "days": 3, "makeup_work": "1 月 4 日"},
{"name": "春节", "dates": "2 月 15 日 -2 月 23 日", "days": 9, "makeup_work": "2 月 14 日、2 月 28 日"},
{"name": "清明节", "dates": "4 月 4 日 -4 月 6 日", "days": 3, "makeup_work": "无"},
{"name": "劳动节", "dates": "5 月 1 日 -5 月 5 日", "days": 5, "makeup_work": "5 月 9 日"},
{"name": "端午节", "dates": "6 月 19 日 -6 月 21 日", "days": 3, "makeup_work": "无"},
{"name": "中秋节", "dates": "9 月 25 日 -9 月 27 日", "days": 3, "makeup_work": "无"},
{"name": "国庆节", "dates": "10 月 1 日 -10 月 7 日", "days": 7, "makeup_work": "9 月 20 日、10 月 10 日"}
]
}User says: "Output all 2026 holiday arrangements in JSON format"
Operation:
- Run the script to obtain data
- Organize and output according to the JSON format required by the user
Output example:
json
{
"year": 2026,
"holidays": [
{"name": "元旦", "dates": "1 月 1 日 -1 月 3 日", "days": 3, "makeup_work": "1 月 4 日"},
{"name": "春节", "dates": "2 月 15 日 -2 月 23 日", "days": 9, "makeup_work": "2 月 14 日、2 月 28 日"},
{"name": "清明节", "dates": "4 月 4 日 -4 月 6 日", "days": 3, "makeup_work": "无"},
{"name": "劳动节", "dates": "5 月 1 日 -5 月 5 日", "days": 5, "makeup_work": "5 月 9 日"},
{"name": "端午节", "dates": "6 月 19 日 -6 月 21 日", "days": 3, "makeup_work": "无"},
{"name": "中秋节", "dates": "9 月 25 日 -9 月 27 日", "days": 3, "makeup_work": "无"},
{"name": "国庆节", "dates": "10 月 1 日 -10 月 7 日", "days": 7, "makeup_work": "9 月 20 日、10 月 10 日"}
]
}故障排查
Troubleshooting
搜索无结果
No search results
错误现象: 脚本返回"未找到相关节假日通知"或"搜索结果为空"
可能原因:
- 该年份的节假日通知尚未发布(通常上一年度 11-12 月发布下一年度安排)
- 网络连接问题
Agent 处理方式:
- 如果查询的是未来年份,提示用户该年度通知尚未发布
- 建议用户查询已发布的年份(如当前年份或上一年)
- 如网络问题,向用户说明情况并建议稍后重试
Error phenomenon: The script returns "No relevant holiday notice found" or "Search result is empty"
Possible reasons:
- The holiday notice for this year has not been released yet (usually the next year's arrangement is released in November-December of the previous year)
- Network connection problem
Agent processing method:
- If querying a future year, prompt the user that the notice for that year has not been released yet
- Suggest users to query published years (such as the current year or the previous year)
- If it is a network problem, explain the situation to the user and suggest trying again later
在线获取失败
Online acquisition failed
错误现象: 脚本退出并显示网络请求失败
可能原因:
- 网络连接不稳定
- 政府网接口参数发生变更
Agent 处理方式:
- 检查网络连接后重试一次
- 如仍失败,向用户说明"政府网数据暂时无法获取"
- 建议用户使用缓存数据(参数移除)或稍后重试
--force - 如用户需要,可告知用户直接访问政府网查看
Error phenomenon: The script exits and shows that the network request failed
Possible reasons:
- Unstable network connection
- The interface parameters of the government website have changed
Agent processing method:
- Check the network connection and try again once
- If it still fails, explain to the user that "the government website data is temporarily unavailable"
- Suggest users to use cached data (remove the parameter) or try again later
--force - If the user needs, you can tell the user to directly visit the government website to view
内容解析失败
Content parsing failed
错误现象: 获取到 URL 但无法提取有效内容
Agent 处理方式:
- 向用户说明"内容解析失败"
- 将原始 URL 提供给用户,让用户手动访问查看
- 建议用户稍后重试
Error phenomenon: The URL is obtained but valid content cannot be extracted
Agent processing method:
- Explain to the user that "content parsing failed"
- Provide the original URL to the user for manual access
- Suggest the user to try again later
缓存数据不存在
Cache data does not exist
错误现象: 本地无缓存且在线获取失败
Agent 处理方式:
- 向用户说明该年份数据暂时无法获取
- 建议用户查询其他年份
- 或建议用户稍后重试
通用处理原则:
- 任何错误都应向用户清晰说明原因和建议
- 优先尝试使用缓存数据
- 网络问题建议用户稍后重试
- 提供替代方案(如查询其他年份、访问政府网)
Error phenomenon: No local cache and online acquisition failed
Agent processing method:
- Explain to the user that the data for this year is temporarily unavailable
- Suggest users to query other years
- Or suggest users to try again later
General processing principles:
- Clearly explain the cause and suggestions to the user for any error
- Prioritize trying to use cached data
- Suggest users to try again later for network problems
- Provide alternative solutions (such as querying other years, visiting the government website)
技术说明
Technical Description
- 数据来源:中国政府网(www.gov.cn)官方发布的国务院办公厅通知
- 数据权威性:来源于国务院公报,具有官方效力
- 更新频率:通常每年 11-12 月发布下一年度安排
- 缓存策略:本地缓存优先,减少网络请求,提升响应速度
- Data source: Notice of the General Office of the State Council officially released by the official website of the Chinese government (www.gov.cn)
- Data authority: From the State Council Gazette, with official effect
- Update frequency: Usually the next year's arrangement is released in November-December every year
- Cache strategy: Local cache first, reduce network requests, improve response speed
缓存机制
Cache Mechanism
脚本采用缓存优先策略:
- 优先读取本地缓存:检查 是否存在
assets/{年份}.md - 缓存命中:直接返回缓存数据(毫秒级响应,无需网络)
- 缓存未命中:自动从政府网获取数据并缓存到本地
Agent 处理建议:
- 默认情况下直接使用缓存数据
- 当用户表达"重新获取"、"刷新数据"、"从网上查最新的"等意图时,应理解为需要强制从网络获取最新数据
- 缓存文件位于 ,每年新数据发布后会自动更新
assets/{年份}.md
The script adopts a cache-first strategy:
- Prioritize reading local cache: Check whether exists
assets/{年份}.md - Cache hit: Return cached data directly (millisecond-level response, no network required)
- Cache miss: Automatically fetch data from the government website and cache it locally
Agent processing suggestions:
- Use cached data directly by default
- When the user expresses intentions such as "re-fetch", "refresh data", "check the latest from the Internet", it should be understood that the latest data needs to be forcibly obtained from the network
- The cache file is located at , and will be automatically updated after the new data is released every year
assets/{年份}.md
技巧
Tips
- 缓存策略:脚本优先使用本地缓存,响应更快
- 发布时间:国务院办公厅通常在每年 11-12 月发布下一年度节假日安排
- 刷新数据:当用户要求"重新获取"、"刷新"时,应强制从网络获取最新数据
- 默认年份:用户未指定年份时,主动询问或使用当前年份
- 离线使用:已有缓存的年份可以完全离线查询
- 数据权威性:所有数据来自中国政府网(www.gov.cn),具有官方效力
- 跨年度对比:可以分别获取不同年份数据进行对比分析
- 格式灵活:支持按用户要求输出 JSON、表格、列表等不同格式
- Cache strategy: The script prioritizes using local cache for faster response
- Release time: The General Office of the State Council usually releases the next year's holiday arrangement in November-December every year
- Refresh data: When the user requests "re-fetch" or "refresh", the latest data should be forcibly obtained from the network
- Default year: When the user does not specify the year, take the initiative to ask or use the current year
- Offline use: Years with existing cache can be queried completely offline
- Data authority: All data comes from the official website of the Chinese government (www.gov.cn), with official effect
- Cross-year comparison: Data of different years can be obtained respectively for comparative analysis
- Flexible format: Support output in different formats such as JSON, table, list according to user requirements
注意事项
Notes
- 数据时效性:只能查询已发布的年份,未来年份的通知需等待官方发布
- 官方来源:所有数据均来自政府网官方渠道,确保准确性
- 调休安排:输出时务必包含调休上班日期的说明,方便用户安排工作
- Data timeliness: Only published years can be queried, and notices for future years need to wait for official release
- Official source: All data comes from official channels of the government website to ensure accuracy
- Work rescheduling arrangement: Be sure to include the description of the work rescheduling date when outputting, which is convenient for users to arrange work