Skip to content

eartharoid/holidays

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚧 Work in progress 🚧

https://github.com/workalendar/workalendar/blob/master/workalendar/europe/united_kingdom.py https://www.ukbankholidays.co.uk/ https://en.wikipedia.org/wiki/Wedding_of_Princess_Anne_and_Mark_Phillips https://en.wikipedia.org/wiki/Public_holidays_in_the_United_Kingdom https://github.com/commenthol/date-holidays/blob/master/docs/specification.md#citations-sources-and-attribution https://github.com/commenthol/date-holidays/blob/master/docs/specification.md#types-of-holidays https://en.wikipedia.org/wiki/Civil_Service_(United_Kingdom)#Privilege_days

Holidays

Data and APIs for public/bank holidays in supported countries.

Why?

To add a minor feature to one of my other projects, I needed a simple way to check if today is a holiday that worked for most countries, and I wasn't satisfied with the existing solutions. Unfortunately, holidays are not as simple as they seem (cough Scotland).

What's wrong with existing solutions?

Most of them work, but after looking at several open-source projects that calculate dates, I was stuck thinking about how the code would be better represented as data.

  • https://www.gov.uk/bank-holidays.json: only works for the UK
  • Nager.Date: accurate, but the API isn't flexible enough to overcome regional inconsistencies, not multi-lingual
  • holidayapi.com: stupidly expensive
  • timeanddate.com: probably very good, but even more stupidly expensive
  • Azure Open Datasets: difficult to access, probably doesn't get updated
  • enrico: weird API and uses XML
  • python-holidays: excellent, but I didn't want to make an API in python
  • workalendar: good, but python again
  • date-holidays: FINALLY! someone decided to make data with rules instead of code.... but not well. In my opinion, its far more confusing and difficult to follow or update than any of the solutions above that use code

Goals and scope

There have been many changed and additional UK holidays in the last few years, so this was made with the following goals in mind:

Limitations

Usage

You can use the data either

  • through the HTTP API
  • by downloading or building a database (which can optionally queried with a helper library)

HTTP API

Data for the last decade, the current decade, and the next decade (currently 2010-2039 inclusive) is available for supported countries with the free API.

Read the documentation →

Databases

These URLs have a cache time of 1 week. You should update local copies at least every few months to ensure correctness.

https://static.eartharoid.me/holidays/v1/<country>.<size>.<format>

Note

<country> may be an ISO 3166-1 alpha-2 country code, or global.

Sizes

Size Years
xs (1) current year
sm (3) previous, current, & next year
lg (11) current year ± 5 years
xl (30) previous, current, & next decade

Formats

  • sqlite
  • json

Examples:

https://static.eartharoid.me/holidays/v1/global.xl.sqlite
https://static.eartharoid.me/holidays/v1/gb.sm.json

Libraries

Countries

Please consider sponsoring or donating to your country's contributors.

Note

what about international calendars?

Country Code From Contributors
United Kingdom GB 1995 @eartharoid

Contributing

Please help to add countries and missing or incorrect holidays.

Read the contributing guidelines for more information.

License

Data (data/*.yml) is available under the Open Database License.

Everything else is licensed under the MIT License.