360 Secure SkillHub
360 安全技能中心

China Holiday Calculator

提供中国大陆日历查询服务,可判断任意日期是否为法定节假日、周末或调休补班日,并获取节假日名称;支持按年份列出节假日,以及查询北京、上海、广州、深圳等城市的寒暑假信息。以命令行脚本与 Python 函数接口两种方式调用,依赖 chinese-calendar 包。

manucode2000-max
manucode2000-max
热度 47.86
最近更新 2026-05-11 17:35:46
分类:生活依赖:代码执行 / 读写文件应用场景:日程安排

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add china-holiday-calc
Metadata
name
china-holiday-calc
description
Chinese mainland calendar service - identifies法定节假日, weekends, makeup workdays, and supports city-specific vacations
license
MIT

China Holiday

中国大陆日历服务,判断任意日期的假期状态。

Features

  • 法定节假日: 元旦、春节、清明、五一、端午、中秋、国庆
  • 调休: 识别补班日
  • 周末: 自动识别周六、周日
  • 寒暑假: 支持主要城市
  • 春秋假: 部分地区学校

Usage

# Check if today is a holiday
python holiday.py today

# Check specific date
python holiday.py 2026-01-01

# Query Beijing summer vacation
python holiday.py vacation 北京

# List all holidays for a year
python holiday.py list 2026

API

from holiday import is_holiday, is_workday, get_holiday_name

# Check if holiday
is_holiday("2026-01-01")  # True (New Year's Day)

# Check if workday
is_workday("2026-01-28")  # True (Spring Festival makeup workday)

# Get holiday name
get_holiday_name("2026-01-01")  # "元旦"

Supported Cities

  • Beijing, Shanghai, Guangzhou, Shenzhen
  • More cities to be added...

Implementation

Uses official Chinese government holiday schedules with local variations for schools and universities.

License

MIT License