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.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27b470ff3a44cc8d0436e00ebda8b1541588a37fb9fc78d79867691a87e0deba
|
|
| MD5 |
4407bf716a0b93c52b270bc38ebda368
|
|
| BLAKE2b-256 |
039e5042f4e4f842ab7395c2d17a5840eca14f29bcf75351af42caa86129a613
|
File details
Details for the file taiwan_holidays-0.2026.0-py3-none-any.whl.
File metadata
- Download URL: taiwan_holidays-0.2026.0-py3-none-any.whl
- Upload date:
- Size: 15.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58a58c6c6e6acaf74e2e6da4151d673dfabb02f55bdd148dccc5ca2cc656fd7d
|
|
| MD5 |
c07d433a31363d0e123249e7a5eeec4b
|
|
| BLAKE2b-256 |
efac2e09afb7a23cc6195d700a5fe62ccdd0085c2b5e8c67d6c8004472e36b06
|