Skip to main content

A Python tool for managing Chinese public holidays and compensatory working days. This tool helps you accurately calculate working days while accounting for China's unique holiday schedule.

Project description

cnworkdays

A Python tool for managing Chinese public holidays and compensatory working days. This tool helps you accurately calculate working days while accounting for China's unique holiday schedule.

Features

  • Holiday Announcement Parser: parse official holiday announcements from the General Office of the State Council to generate data for annual public holidays and compensatory working days in China.

  • Working Day Calculator: calculate dates before or after a specified number of working days, taking into account official public holidays and compensatory working days in China.

Installation

pip install cnworkdays

Usage

cnworkdays provides two main commands: holiparse and workcalc.

Holiday Announcement Parser

Launch the web application for parsing holiday announcements:

cnworkdays holiparse

✨ Running marimo app Holiday Announcement Parser
🔗 URL: http://127.0.0.1:8080

By default, the application runs at http://127.0.0.1:8080. To customize the host and port:

cnworkdays holiparse --host 0.0.0.0 --port 9000 Running marimo app Holiday Announcement Parser
🔗 URL: http://0.0.0.0:9000

Working Day Calculator

Launch the web application for calculating working days:

cnworkdays workcalc

✨ Running marimo app Working Day Calculator
🔗 URL: http://127.0.0.1:8080

By default, the application runs at http://127.0.0.1:8080. To customize the host and port:

cnworkdays workcalc --host 0.0.0.0 --port 9000 Running marimo app Working Day Calculator
🔗 URL: http://0.0.0.0:9000

Changelog

2025.0

Release date: 2024-11-25

  • Extend date calculation support for cnworkdays workcalc through December 31, 2025.
  • Fix the issue that cnworkdays holiparse fails to parse CY25 announcement.

2024.1

Release date: 2024-11-25

  • Enhance browser application with more descriptive page titles for better user experience.
  • Fix the issue that workcalc gets stuck when negative days are provided.

2024.0

Release date: 2024-11-13

  • Launch cnworkdays CLI with two main commands:

    • holiparse: generate data for annual public holidays and compensatory working days based on notifications from the General Office of the State Council.
    • workcalc: calculate the date after or before a specified number of working days, accounting for official public holidays and compensatory working days in China.
  • Add support for date calculations spanning from January 1, 2018, to December 31, 2024.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cnworkdays-2025.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cnworkdays-2025.0-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file cnworkdays-2025.0.tar.gz.

File metadata

  • Download URL: cnworkdays-2025.0.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.21.0 CPython/3.10.12 Linux/6.5.0-1025-azure

File hashes

Hashes for cnworkdays-2025.0.tar.gz
Algorithm Hash digest
SHA256 451a1e80adfc71831a0759d836e7bf134da608ac97abb6864a02ce75276b1323
MD5 edf68f887588b6a98164a7eed3d6cdaa
BLAKE2b-256 42d64c7767e08da22658600a228ab11d320a35570071b9ef652ebf3a7e9723b1

See more details on using hashes here.

File details

Details for the file cnworkdays-2025.0-py3-none-any.whl.

File metadata

  • Download URL: cnworkdays-2025.0-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.21.0 CPython/3.10.12 Linux/6.5.0-1025-azure

File hashes

Hashes for cnworkdays-2025.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4fdc9b55211069b29902649ba858ecf83b6b6c77d6ae95a9e25d8a055b0245e0
MD5 4ea12aed45572beca2989585fe3dab1e
BLAKE2b-256 d7fb5de509e5eff69d09614eaab06e79f06180bddf128b1cfba828f9d392e43f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page