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

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.0.tar.gz (55.9 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.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for taiwan_holidays-0.2026.0.tar.gz
Algorithm Hash digest
SHA256 27b470ff3a44cc8d0436e00ebda8b1541588a37fb9fc78d79867691a87e0deba
MD5 4407bf716a0b93c52b270bc38ebda368
BLAKE2b-256 039e5042f4e4f842ab7395c2d17a5840eca14f29bcf75351af42caa86129a613

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for taiwan_holidays-0.2026.0-py3-none-any.whl
Algorithm Hash digest
SHA256 58a58c6c6e6acaf74e2e6da4151d673dfabb02f55bdd148dccc5ca2cc656fd7d
MD5 c07d433a31363d0e123249e7a5eeec4b
BLAKE2b-256 efac2e09afb7a23cc6195d700a5fe62ccdd0085c2b5e8c67d6c8004472e36b06

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