You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
python-holidays only supports prov and state subdivisions, however states are subdivided into one or more from these categories:
cantons
commune
councils
counties
departments
dependencies
districts
divisions
emirates
entities
governorates
governorates
islands, groups of islands
Länder
administrations
municipalities
parishes
prefectures
provinces
rayons
regions
sectors
states
territories
towns
unitary authorities
voivodships
wards
Instead of expanding the types of subdivisions naming supported by this library, I propose adopting ISO 3166-2 (https://en.wikipedia.org/wiki/ISO_3166-2) which already standardizes all types of subdivisions into a non-overlapping namespace.
I envision being able to initialize holidays for the state of California in the USA (ISO 3166-2 code US-CA) as follows: us_ca_holidays = holidays.US('CA'),
for the Emirate of Dubai as follows: dubai_holidays = holidays.AE('DU'),
for the Ağsu rayon in Azerbajan as follows: az-agu_holidays = holidays.AZ('AGU')
and so on.
@dr-prodigy I can work on a pull request [with backward compatibility] if I know it's going to be utilized, but won't work on it otherwise.
The text was updated successfully, but these errors were encountered:
Hey there @mborsetti
sorry this proposal went unnoticed until now, my bad!
This is definitely a great idea, which would provide a definitely higher flexibility in the config/init phase.. especially if coupled to .CountryHoliday('[CODE]').
As long as we provide compatibility with previous versions, I totally agree with your analysis and would really appreciate your improvement. In the meanwhile, I can help you out with the task, if you wish.
python-holidays
only supportsprov
andstate
subdivisions, however states are subdivided into one or more from these categories:Instead of expanding the types of subdivisions naming supported by this library, I propose adopting ISO 3166-2 (https://en.wikipedia.org/wiki/ISO_3166-2) which already standardizes all types of subdivisions into a non-overlapping namespace.
I envision being able to initialize holidays for the state of California in the USA (ISO 3166-2 code US-CA) as follows:
us_ca_holidays = holidays.US('CA')
,for the Emirate of Dubai as follows:
dubai_holidays = holidays.AE('DU')
,for the Ağsu rayon in Azerbajan as follows:
az-agu_holidays = holidays.AZ('AGU')
and so on.
@dr-prodigy I can work on a pull request [with backward compatibility] if I know it's going to be utilized, but won't work on it otherwise.
The text was updated successfully, but these errors were encountered: