vacanza / holidays

Generate and work with holidays in Python
https://pypi.org/project/holidays
MIT License
1.45k stars 460 forks source link

v1: entity types and structure standardization #1650

Open arkid15r opened 8 months ago

arkid15r commented 8 months ago

The current version has 2 main types of supported entities: country and financial. Not all entities of the country type can be countries per se. As ISO3166 defines a broader set of supported entities, e.g. names of countries, dependent territories, and special areas of geographical interest it'd be fair to rename accordingly, use iso3166 as a placeholder for iso3166 based entities. Keeping it as is for financial/market category can be a good idea.

The iso3166 entity files would be named according to their iso3166-1 codes.

Another point is the difference for specifying the code for country/market entities: using a standardized attribute name for both types would be more consistent. The difference could be provided based on class inheritance (separate base classes for iso3166 and financial entities) and/or entity_type field.

Questions and ideas are welcome!

arkid15r commented 8 months ago

This also should address concerns raised in https://github.com/vacanza/python-holidays/pull/1063