Skip to main content

A Python package for determining whether a given date is a workday or a holiday in Taiwan, based on the official administrative calendar.

Project description

taiwan-holidays

taiwan-holidays is a Python package designed to check whether a specific date is a workday or a holiday in Taiwan, based on the official work calendar provided by the Taiwan government.

coverage license Python 3.9 Python 3.10 Python 3.11 Python 3.12 Python 3.13 PyPI Downloads

Features

  • Determine if a date is a workday or holiday.
  • Support for official Taiwan government work calendar rules, including special adjusted workdays and holidays.
  • Easy-to-use API for date checking.
  • Currently, only the official Taiwanese government calendar of public working days starting from the year 2019 (Republic of China year 108) onwards is supported.

Installation

You can install taiwan-holidays via pip:

pip install taiwan-holidays

Usage

Here's how you can use taiwan-holidays in your Python project.

Example

from taiwan_holidays.taiwan_calendar import TaiwanCalendar


calendar = TaiwanCalendar()
date = dateutil.parser.parse('2024-12-08')
print(calendar.is_holiday(date))
print(calendar.is_holiday('2024-12-08'))
print(calendar.is_holiday('20241208'))
print(calendar.is_holiday('2024/12/08'))

# Iterate workdays through a range of dates, including the start and end dates
calendar.iter_workdays('2024-12-01', '2024-12-31')

# Also you can iterate with reversed dates
calendar.iter_workdays('2024-12-31', '2024-12-01')

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements

Special thanks to the Taiwan government for providing the official administrative calendar as the basis for this package.

Feel free to report any issues or suggest new features in the Issues section.

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

taiwan_holidays-0.2026.2.tar.gz (58.2 kB view details)

Uploaded Source

Built Distribution

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

taiwan_holidays-0.2026.2-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file taiwan_holidays-0.2026.2.tar.gz.

File metadata

  • Download URL: taiwan_holidays-0.2026.2.tar.gz
  • Upload date:
  • Size: 58.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.7

File hashes

Hashes for taiwan_holidays-0.2026.2.tar.gz
Algorithm Hash digest
SHA256 af628a68737c3c5eb3c307358b47b451f989a2d4c1bf6822184083925b9b7ed9
MD5 4f36eebaeae7a9b3754bd11250436f95
BLAKE2b-256 214009f1a970b2262bd547af59058b90e9edef5807bbfd6ec78d8e4bcc034e04

See more details on using hashes here.

File details

Details for the file taiwan_holidays-0.2026.2-py3-none-any.whl.

File metadata

File hashes

Hashes for taiwan_holidays-0.2026.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6db1aaeca90881833b0f164be733648f2b8a3a13e969184dad95a4bf60f90bd5
MD5 c23fdc17f015a08c9ea10369b6befdc5
BLAKE2b-256 0c58cd8b884ebdbfa0d7be023c4a3281813aa64e222ae541ed71c96e4a07d518

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