360 Secure SkillHub
360 安全技能中心

Check Workday CN

通过 Python 脚本查询 holiday-cn 年度节假日 JSON,判断指定日期(默认今天,Asia/Shanghai)在中国大陆是否为工作日;输出查询日期、is_workday 布尔值、判断依据(节假日覆盖或星期回退)及数据来源。

分类:自动化
sube-py
sube-py
热度 38.23
最近更新 2026-05-11 17:30:03

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add sube-py/check-workday-cn
兼容性
通用兼容
联网要求
需要联网
数据出网
数据不出本机
Metadata
name
check-workday-cn
description
Determine whether today (or a given date) is a working day in mainland China by querying holiday-cn yearly JSON from jsDelivr and applying holiday/makeup-workday rules. Use when users ask questions like "今天是不是工作日", "这天要不要上班", "是不是节假日/调休补班", or when a workflow needs a reliable workday boolean.

Check Workday CN

Check whether today is a workday with official holiday override data from: https://cdn.jsdelivr.net/gh/NateScarlet/holiday-cn@master/{year}.json

Workflow

  1. Run python3 scripts/check_today_workday.py.
  2. Read is_workday from output.
  3. Explain reason:
    • If date exists in days[], use isOffDay directly (false => workday, true => off day).
    • If date does not exist in days[], fall back to weekday rule (Mon-Fri workday, Sat-Sun off day).

Commands

Use today in Asia/Shanghai:

python3 scripts/check_today_workday.py

Check specific date:

python3 scripts/check_today_workday.py --date 2026-02-15

Machine-readable output:

python3 scripts/check_today_workday.py --json

Output Contract

Always return:

  • Queried date (YYYY-MM-DD)
  • is_workday boolean
  • Reason (holiday override or weekday fallback)
  • Data source URL