Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

US business days - configurable options #2

Closed
dmk23 opened this issue Aug 28, 2014 · 1 comment
Closed

US business days - configurable options #2

dmk23 opened this issue Aug 28, 2014 · 1 comment

Comments

@dmk23
Copy link

dmk23 commented Aug 28, 2014

I have reviewed/tested the code to check what exactly it does with US.

My assumption is that the main use for the module is to identify business vs. non-business days. Seems like there might some discrepancies / options at least within US.

The current list seems to reflect US Post Office schedule, though most businesses are likely to follow Bank Holiday schedule (no business if bank is closed - main difference banks closed on Easter).

Moreover, there are some special cases (e.g. "long weekends" with extra Friday on Thanksgiving, etc, early business closing on "pre-holiday" days, like xmas/new year and possibly others).

I wonder if it might be valuable to make things like this configurable beyond the basic USPS schedule?

References -
http://www.theholidayschedule.com/post-office-holidays.php
http://www.theholidayschedule.com/bank-holidays.php
http://www.theholidayschedule.com/nyse-holidays.php

@ghost ghost added the enhancement label Aug 29, 2014
@ghost
Copy link

ghost commented Aug 29, 2014

I have not heard of there being an Easter bank holiday before. Admittedly I am not as familiar with US holidays as Canadian, but I've written a lot of software that deals with processing ACH transactions in the US system where holidays have to be taken into account and I've never seen transactions delayed due to Easter. The Federal Reserve does not consider it a holiday[1].

I'd definitely be open to adding some additional options for the US if there were some clear standards that appeared to be agreed on, but that doesn't seem to be the case?

For special cases like Christmas Eve and New Year's Eve, which only some industries/companies observe, it is quite easy to create your own custom holiday class by inheriting from one of the existing classes.

Example:

>>> from datetime import date
>>> import holidays
>>> 
>>> class NYSEHolidays(holidays.US):
>>>     def _populate(self, year):
>>>         # Add standard holidays from holidays.US class
>>>         holidays.US._populate(self, year)
>>>         # Add custom holiday
>>>         self[date(year, 12, 24)] = "Christmas Eve"
>>> 
>>> print '2014-12-24' in NYSEHolidays()
True

[1] - http://www.federalreserve.gov/aboutthefed/k8.htm

@ghost ghost closed this as completed Aug 29, 2014
dr-prodigy added a commit that referenced this issue Jan 14, 2018
Fix Queen's birthday in AU/Queensland closes #90
giladmaya pushed a commit to giladmaya/python-holidays that referenced this issue Jan 23, 2020
Fix Queen's birthday in AU/Queensland closes vacanza#90
dr-prodigy pushed a commit that referenced this issue Jan 30, 2021
arkid15r referenced this issue in arkid15r/python-holidays Dec 20, 2022
KJhellico referenced this issue in KJhellico/python-holidays Feb 7, 2023
@arkid15r arkid15r mentioned this issue Mar 18, 2024
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant