#calendar #business #exchange #holiday


Simple tool for calculating holidays based on a set of holiday rules

5 releases

0.2.0 Feb 24, 2023
0.1.3 Jun 21, 2022
0.1.2 Apr 20, 2022
0.1.1 Apr 18, 2022
0.1.0 Apr 18, 2022

#314 in Date and time

Download history 99/week @ 2023-08-10 69/week @ 2023-08-17 70/week @ 2023-08-24 74/week @ 2023-08-31 143/week @ 2023-09-07 113/week @ 2023-09-14 89/week @ 2023-09-21 80/week @ 2023-09-28 92/week @ 2023-10-05 45/week @ 2023-10-12 44/week @ 2023-10-19 60/week @ 2023-10-26 38/week @ 2023-11-02 59/week @ 2023-11-09 80/week @ 2023-11-16 77/week @ 2023-11-23

259 downloads per month
Used in finql


893 lines


Purpose of this library is to provide a tool for calculating holidays for a given time period based on a set of rules.

The following rules are supported:

  • Week day: any day of week (e.g. Sunday)
  • Yearly days: same date every year
  • Moveable yearly days: as yearly days, but moved to the next non-weekend day if it falls on a weekday
  • Modified movable yearly days: Move to Friday if it falls on Saturday and to Monday if it falls on Sunday
  • Single day: special holiday valid only in one year
  • Easter offset: day that is calculated relative to Easter sunday
  • Month week day: nth weekday of a given month



This examples demonstrates using the library to calculate the UK settlement calendar, which is particular interesting because of its complex holiday rules, e.g. last Monday of August (Summer bank holiday), fixed day holidays that are moved to the next working day if the holiday falls on a weekend, or singular holidays which are not repeated every year, but celebrate unique events like a royal wedding.


~38K SLoC