python-holidays icon indicating copy to clipboard operation
python-holidays copied to clipboard

v1 roadmap

Open arkid15r opened this issue 2 years ago • 4 comments

This is a placeholder for all tickets that need to be addressed to release library first stable version.

The v1 version isn't going to be backward compatible with v0 instead it'll be focused on better user experience and standardization of supported entities and provided API. The v1 and following versions should comply with semantic versioning approach.

At some point v0 library support will be limited to maintenance releases / bug fixes only.

  • https://github.com/vacanza/holidays/issues/1650
  • https://github.com/vacanza/holidays/issues/1651
  • https://github.com/vacanza/holidays/issues/1151
  • https://github.com/vacanza/holidays/issues/1474
  • https://github.com/vacanza/holidays/issues/1655
  • https://github.com/vacanza/holidays/issues/1658
  • https://github.com/vacanza/holidays/issues/1681
  • https://github.com/vacanza/holidays/issues/1696
  • https://github.com/vacanza/holidays/issues/2176
  • https://github.com/vacanza/holidays/issues/2177
  • https://github.com/vacanza/holidays/issues/2179
  • https://github.com/vacanza/holidays/issues/1713
  • https://github.com/vacanza/holidays/issues/1394

arkid15r avatar Jan 22 '24 16:01 arkid15r

@arkid15r is there a planned release date for the v1? Thank you very much!

ramibch avatar Apr 18 '25 08:04 ramibch

@arkid15r is there a planned release date for the v1? Thank you very much!

@ramibch I wish I had a straight answer to this. Instead here is some context:

  • our grant application wasn't approved (I hoped it'd boost v1 development a lot)
  • on the other hand we got accepted into GSoC 2025 under PSF and looking forward to adding more entity coverage this year

We still plan to implement v1, but I guess we'll need to shift it a bit. Do you have any specific interest in v1 features?

arkid15r avatar Apr 27 '25 18:04 arkid15r

@arkid15r thank you very much for your response!

I would be glad if there is a standard method that returns country regions in a standar way ( I suppose this is well known in the project). At the moment get_subdivision_aliases returns different formats depeding on the country.

I have created some calendars in my website with different countries and their regions with the library (example: https://ramib.ch/cal/2027/NI/ES) and in order to get the region name I had to write an ugly method (friendly_subdiv) like this:


from django.db import models
from django.utils.functional import cached_property

class YearlyHolidayCalender(models.Model):
    year = models.SmallIntegerField()
    country = models.CharField(max_length=2, choices=settings.COUNTRIES)
    subdiv = models.CharField(max_length=128, null=True, blank=True)
    lang = models.CharField(max_length=2, choices=settings.LANGUAGES)
    pdf = models.FileField(null=True, blank=True, upload_to="calendars/")

    # ...

    @cached_property
    def friendly_subdiv(self):
        if self.subdiv is None:
            return ""
        else:
            hdays = getattr(holidays, self.country)
            try:
                value = hdays.get_subdivision_aliases()[self.subdiv]
            except KeyError:
                return self.subdiv

            if value:
                return value[0]
                # return " ".join(value)
            else:
                return self.subdiv

ramibch avatar May 01 '25 21:05 ramibch

@ramibch I'm not sure -- it sounds like your best option is list_supported_countries:

list_supported_countries()['NI']
['AN', 'AS', 'BO', 'CA', 'CI', 'CO', 'ES', 'GR', 'JI', 'LE', 'MD', 'MN', 'MS', 'MT', 'NS', 'RI', 'SJ']

Not all subdivisions have aliases. If you need subdivision full name I suggest looking at something like this

arkid15r avatar May 01 '25 22:05 arkid15r