Chinese Workdays

v2.0.0

Calculate legal working days in China according to official government holiday schedules. Uses State Council-published arrangements to exclude weekends, publ...

0· 139·1 current·1 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for manucode2000-max/chinese-workdays.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Chinese Workdays" (manucode2000-max/chinese-workdays) from ClawHub.
Skill page: https://clawhub.ai/manucode2000-max/chinese-workdays
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install chinese-workdays

ClawHub CLI

Package manager switcher

npx clawhub@latest install chinese-workdays
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description (calculate Chinese legal workdays) matches the code and included YAML data files. Required resources are local files and PyYAML; nothing requests unrelated cloud credentials or binaries.
Instruction Scope
SKILL.md instructions align with the implementation (manual update of YAML, local calculations, CLI examples). The code will create example YAML files under the package data directory if the data folder is missing — this is reasonable but worth noting because it writes files into the package path. PUBLISH.md mentions automated yearly updates, but the code contains no auto-update or network-fetch logic (the README/skill says manual update); this is an inconsistency in documentation/roadmap only.
Install Mechanism
No install spec provided; skill is a normal Python package with source files and YAML data. There are no remote downloads or extract steps, and no unusual install locations. PyYAML is used (declared in PUBLISH.md), so runtime dependency installation is required but expected.
Credentials
The skill requires no environment variables, credentials, or config paths. All data is local YAML. No secrets are requested or referenced by the code or SKILL.md.
Persistence & Privilege
always is false and the skill does not request persistent system privileges or modify other skills. It writes example YAML into its data directory if missing (normal for a data-driven package) but does not alter system-wide settings.
Assessment
This skill appears coherent and implements a local calculator using the included YAML holiday schedules. Before installing: (1) be aware it requires PyYAML to parse the YAML files; (2) it may create or write YAML files under the package's data directory (this is not network I/O but will write to disk); (3) PUBLISH.md and subscription.json mention publishing/pricing and automated yearly updates, but the shipped code does not perform automatic network updates — updates are manual by editing the YAML files; (4) review the included YAML data for accuracy if you rely on it for official or business-critical calculations. No credentials or network endpoints are requested by the code, so there is no sign of data exfiltration.

Like a lobster shell, security has layers — review code before you run it.

21yearsvk97dg3bykdjbyd4x8cm32pv56583hvwpauthoritativevk97dg3bykdjbyd4x8cm32pv56583hvwpchinavk97dg3bykdjbyd4x8cm32pv56583hvwpcompletevk97dg3bykdjbyd4x8cm32pv56583hvwpcomprehensivevk97dg3bykdjbyd4x8cm32pv56583hvwphistoricvk97dg3bykdjbyd4x8cm32pv56583hvwpholidaysvk97dg3bykdjbyd4x8cm32pv56583hvwplatestvk97dg3bykdjbyd4x8cm32pv56583hvwpmilestonevk97dg3bykdjbyd4x8cm32pv56583hvwpofficialvk97dg3bykdjbyd4x8cm32pv56583hvwpproductionvk97dg3bykdjbyd4x8cm32pv56583hvwpv2vk97dg3bykdjbyd4x8cm32pv56583hvwpworking-daysvk97dg3bykdjbyd4x8cm32pv56583hvwp
139downloads
0stars
2versions
Updated 1mo ago
v2.0.0
MIT-0

Chinese Workdays Calculator

Calculate the number of working days between two dates according to Chinese government holiday schedules.

Features

  • 📅 Uses official Chinese holiday schedules published by the State Council
  • 🔢 Calculates法定工作日 (legal working days) excluding weekends and public holidays
  • 📊 Supports holiday makeup workdays (调休补班)
  • 🗂️ Stores yearly holiday schedules in simple YAML data files
  • 🔄 Can be updated when new annual holiday arrangements are released
  • 📊 Provides monthly and yearly statistics
  • 🤖 CLI tool for quick calculations

Quick Start

Basic calculation

from chinese_workdays import ChineseWorkdays

calc = ChineseWorkdays()
workdays = calc.count_workdays("2026-01-01", "2026-12-31")
print(f"2026年全年工作日: {workdays}天")

Monthly statistics

march_workdays = calc.get_workdays_in_month(2026, 3)  # 22天

Usage Examples

How many working days are there in March 2026?
Working days in Q1 2026?
Calculate workdays between 2026-02-10 and 2026-03-20
How many workdays in 2026?

Command Line

# Quick calculations
python workdays_cmd.py 2026-03          # March 2026
python workdays_cmd.py 2026-Q1          # Q1 2026
python workdays_cmd.py 2026             # Full year
python workdays_cmd.py 2026-01-01 2026-06-30  # Custom range

Data Format

Holiday schedules are stored in YAML format in the data/ directory:

year: 2026
country: "China"
holidays:
  - name: "元旦"
    start: "2026-01-01"
    end: "2026-01-03"
    days_off: ["2026-01-01", "2026-01-02"]  #放假日期
    makeup_workdays: ["2025-12-28", "2026-01-04"]  # 调休上班
    note: "官方通知原文"

Updating Schedules

The State Council releases next year's holiday arrangement in November. Update the YAML file accordingly:

  1. Locate the official notice at https://www.gov.cn/gongbao/
  2. Extract dates and makeup workdays
  3. Edit data/2027.yaml (or the relevant year)

Implementation Details

  • Uses Python's datetime for date arithmetic
  • Holiday data stored as YAML for easy editing
  • Supports makeup workdays that override weekend status
  • Handles holidays that span multiple days

Limitations

  • Requires holiday schedules to be defined for the years being calculated
  • Only works for dates after 2000 (easily extendable)
  • Does not automatically fetch new schedules (manual update needed)
  • Data accuracy depends on correct YAML configuration

Examples of Output

📅 工作日统计
📊 期间: 2026-01-01 至 2026-12-31
📏 总天数: 365
💼 法定工作日: 248 天

工作日占比: 68.0%

📋 期间包含的节假日:
  • 元旦: 2026-01-01 ~ 2026-01-03
  • 春节: 2026-02-15 ~ 2026-02-23
  ...

Technical Notes

Calculation Priority

  1. Makeup workdays (highest priority) → always counted as working days
  2. Public holidays → excluded from working days
  3. Weekends (Saturday/Sunday) → excluded unless makeup workday
  4. Regular weekdays → counted as working days

Algorithm

for each day in date_range:
    if day in makeup_workdays:
        count += 1
    elif day in public_holidays:
        skip
    elif day is weekend:
        skip
    else:
        count += 1

Files Structure

chinese-workdays/
├── SKILL.md              # This file
├── __init__.py           # Package entry point
├── chinese_workdays.py   # Core calculation engine
├── workdays_cmd.py       # CLI tool
├── README.md             # User documentation (optional)
└── data/
    ├── 2026.yaml         # 2026 holiday schedule (official)
    └── 2027.yaml         # 2027 holiday schedule (template)

License

MIT License - Free to use and modify.

Comments

Loading comments...