Giter Site home page Giter Site logo

Comments (4)

lauft avatar lauft commented on July 20, 2024 3

@sturmer, @h0adp0re the locale et-EE is now available on holidata.net. 🥳

from holidata.

lauft avatar lauft commented on July 20, 2024

Hi!

Adding a locale requires a list of all public holidays, i.e. days "which are defined by law on which business or work are suspended or reduced". To get this started, please provide the online sources of the legal documents which define the holidays.

If you want to help:

  • Gather a list of all public holidays, i.e. days "which are defined by law on which business or work are suspended or reduced" from the source.

  • Now for each holiday:

    • Has it a fixed or variable date?
    • What is the official name (as written in the legal source/calendar)?
    • Is it a regional or nation-wide holiday?
    • If regional, what are the regions the holiday is observed in? (Note: currently only regions defined in ISO_3166-2 are supported)
    • If the holiday date is variable, what is the algorithm to calculate the date? This could be something like "X days before/after easter", "nth (week)day of month", ...
    • Is the holiday observed on a different date or is there a substitute holiday if it falls on a saturday/sunday/...
  • Since holidata provides data since 2011 it would be helpful to know whether a holiday has been renamed/deleted/created since 2011

If you want to contribute a PR:

Create a file et-EE.py in holidata/holidays, enter the new locale et-EE in the list of locales in the __init__.py in the same directory.

Within et-EE.py create a class and the following skeleton:

# coding=utf-8
from dateutil.easter import EASTER_WESTERN

from .holidays import Locale


class et_EE(Locale):
    """
    """

    locale = "et-EE"
    easter_type = EASTER_WESTERN

For each holiday with a fixed date add a line in the following format within the class doc (between the triple-quotes):

  • for regional holidays MM-DD: [<regions>] [<flags>] <name>
  • for nation-wide holidays: MM-DD: [<flags>] <name>

The relevant flags here are F for fixed date and N for national (all regions) and R for religious (e.g. christmas, church holidays). The [<regions>] has to be omitted if it is a nation-wide holiday.

For each holiday holiday with a variable date:

  • If it depends on the easter date, add a line in the following format within the class doc:
    n days (before|after) Easter: [<regions>] [<flags>] <name>
    (for Easter, Easter: ... suffices)
  • If the holiday is held on a specific weekday, add a line in the following format:
    nth. (last)? <weekday> in <month>: [<regions>] [<flags>] <name>
    e.g. 1. monday in august or 2. last saturday in may

Also here the [<regions>] has to be omitted if it is a nation-wide holiday.

If a holiday has a variable date that cannot be covered by the patterns above, add a function holiday_<holiday_name_in_snake_case> to the class. The function must return a List[Holiday]. See the other locales for examples. Such a function is required e.g. if

  • a holiday is proclaimed by the government
  • a holiday is moved to a different date, if they fall on a saturday/sunday/...?
  • a holiday is observed on a different date or there is a substitute holiday when they fall on a saturday/sunday/...
  • a holiday has been renamed/deleted/created since/after 2011

from holidata.

h0adp0re avatar h0adp0re commented on July 20, 2024

Hello, I can help a little in this regard. I don't think I have time to contribute code but here's our law with all our public holidays and other important dates: https://www.riigiteataja.ee/en/eli/ee/525062018003/consolide/current

from holidata.

lauft avatar lauft commented on July 20, 2024

@h0adp0re I have added PR #81 for this. Could you take a look and help to resolve the open questions there?

from holidata.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.