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

Barcelona Local Holidays to be added in Spain (ES) holiday package #1710

Open
SimgeChetin opened this issue Mar 1, 2024 · 2 comments
Open
Assignees

Comments

@SimgeChetin
Copy link

SimgeChetin commented Mar 1, 2024

Hello,
Our company is based in Barcelona and we utilize Barcelona Local Holidays as public holidays in our calculations.
Could you include Barcelona Local Holidays as linked here, in the holidays package?
For example May 20 and September 24 is missing from Spain (ES) holidays package.
Maybe it could be added under regional category.
Thank you.

The code example

from datetime import datetime, timedelta, time
import holidays
import calendar
import pandas as pd

per1 = pd.date_range(start="2024-01-01", end="2024-12-31").tolist()

holiday_lists = {
    "ES": holidays.country_holidays("ES", subdiv="CT"),
}

def is_public_holiday(date, country):
    # Choose holiday list based on the country
    if country not in holiday_lists:
        return False
    return date in holiday_lists[country]

for val in per1:
    if is_public_holiday(val, "ES"):
        print(val, "ES", is_public_holiday(val, "ES"))

Image 1-3-24 at 16 39

@SimgeChetin SimgeChetin changed the title Barcelona Local Holidays Barcelona Local Holidays to be added holiday package Mar 1, 2024
@SimgeChetin SimgeChetin changed the title Barcelona Local Holidays to be added holiday package Barcelona Local Holidays to be added in holiday package Mar 1, 2024
@SimgeChetin SimgeChetin changed the title Barcelona Local Holidays to be added in holiday package Barcelona Local Holidays to be added in Spain (ES) holiday package Mar 1, 2024
@arkid15r
Copy link
Collaborator

arkid15r commented Mar 1, 2024

Hi @SimgeChetin,
thanks for requesting this. We don't treat the source you've referred to as an official one. I found this and this one that confirm the missing holidays.

Please add any official sources if you know any.

@arkid15r arkid15r self-assigned this Mar 1, 2024
@SimgeChetin
Copy link
Author

Hi @SimgeChetin, thanks for requesting this. We don't treat the source you've referred to as an official one. I found this and this one that confirm the missing holidays.

Please add any official sources if you know any.

Hello @arkid15r thanks for your quick response.
I can confirm this one can be taken into consideration for the missing holidays.
Also is it possible to add missing holidays for 2023 as well?
Those would be June 5th 2023 and September 25th 2023.
Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants