gisce / electrical_calendar

Electrical sector holidays and workdays using workalendar. Spain and Portugal data
GNU General Public License v3.0
3 stars 0 forks source link

Create OMIECalendar with correct holidays #6

Closed XaviTorello closed 8 years ago

XaviTorello commented 8 years ago

As agreed on #4:

OMIE Holidays

  1. 01/01 - "Año nuevo"
  2. 01/06 - "Epifanía del Señor"
  3. 03/24 - "Jueves Santo"
  4. 03/25 - "Viernes Santo"
  5. 05/02 - "Lunes siguiente a la Fiesta del Trabajo"
  6. 05/16 - "Lunes de Pascua Granada"
  7. 07/25 - "Santiago Apóstol - Día Nacional de Galicia"
  8. 08/15 - "Asunción de la Virgen"
  9. 10/12 - "Fiesta Nacional de España"
  10. 11/01 - "Todos los Santos"
  11. 12/06 - "Día de la Constitución Española"
  12. 12/08 - "La Inmaculada Concepción"
  13. 12/26 - "Lunes siguiente a la Natividad del Señor - Sant Esteban"

thxs @tinogis

XaviTorello commented 8 years ago

Done!

Created new class OMIECalendar with REECalendar heritance

o=OMIECalendar()
o.holidays(2016)

See d9b714b33580270f7ef61da87116f4a8f7912be1

In [44]: o.holidays(2014) Out[44]: [(datetime.date(2014, 1, 1), 'New year'), (datetime.date(2014, 1, 6), 'Epiphany'), (datetime.date(2014, 4, 17), 'Holy Thursday'), (datetime.date(2014, 4, 18), 'Good Friday'), (datetime.date(2014, 5, 2), 'Workers Day next monday'), (datetime.date(2014, 5, 16), 'Second Easter monday'), (datetime.date(2014, 7, 25), 'St Santiago - Galicia National Day'), (datetime.date(2014, 8, 15), 'Assumption of Mary to Heaven'), (datetime.date(2014, 10, 12), 'National Day'), (datetime.date(2014, 11, 1), 'All Saints Day'), (datetime.date(2014, 12, 6), 'Constitution Day'), (datetime.date(2014, 12, 8), 'Immaculate Conception'), (datetime.date(2014, 12, 26), 'St Esteban')]

In [45]: o.holidays(2015) Out[45]: [(datetime.date(2015, 1, 1), 'New year'), (datetime.date(2015, 1, 6), 'Epiphany'), (datetime.date(2015, 4, 2), 'Holy Thursday'), (datetime.date(2015, 4, 3), 'Good Friday'), (datetime.date(2015, 5, 2), 'Workers Day next monday'), (datetime.date(2015, 5, 16), 'Second Easter monday'), (datetime.date(2015, 7, 25), 'St Santiago - Galicia National Day'), (datetime.date(2015, 8, 15), 'Assumption of Mary to Heaven'), (datetime.date(2015, 10, 12), 'National Day'), (datetime.date(2015, 11, 1), 'All Saints Day'), (datetime.date(2015, 12, 6), 'Constitution Day'), (datetime.date(2015, 12, 8), 'Immaculate Conception'), (datetime.date(2015, 12, 26), 'St Esteban')]

In [46]: o.holidays(2016) Out[46]: [(datetime.date(2016, 1, 1), 'New year'), (datetime.date(2016, 1, 6), 'Epiphany'), (datetime.date(2016, 3, 24), 'Holy Thursday'), (datetime.date(2016, 3, 25), 'Good Friday'), (datetime.date(2016, 5, 2), 'Workers Day next monday'), (datetime.date(2016, 5, 16), 'Second Easter monday'), (datetime.date(2016, 7, 25), 'St Santiago - Galicia National Day'), (datetime.date(2016, 8, 15), 'Assumption of Mary to Heaven'), (datetime.date(2016, 10, 12), 'National Day'), (datetime.date(2016, 11, 1), 'All Saints Day'), (datetime.date(2016, 12, 6), 'Constitution Day'), (datetime.date(2016, 12, 8), 'Immaculate Conception'), (datetime.date(2016, 12, 26), 'St Esteban')]

In [48]: o.holidays(2017) Out[48]: [(datetime.date(2017, 1, 1), 'New year'), (datetime.date(2017, 1, 6), 'Epiphany'), (datetime.date(2017, 4, 13), 'Holy Thursday'), (datetime.date(2017, 4, 14), 'Good Friday'), (datetime.date(2017, 5, 2), 'Workers Day next monday'), (datetime.date(2017, 5, 16), 'Second Easter monday'), (datetime.date(2017, 7, 25), 'St Santiago - Galicia National Day'), (datetime.date(2017, 8, 15), 'Assumption of Mary to Heaven'), (datetime.date(2017, 10, 12), 'National Day'), (datetime.date(2017, 11, 1), 'All Saints Day'), (datetime.date(2017, 12, 6), 'Constitution Day'), (datetime.date(2017, 12, 8), 'Immaculate Conception'), (datetime.date(2017, 12, 26), 'St Esteban')]

In [49]: o.holidays(2018) Out[49]: [(datetime.date(2018, 1, 1), 'New year'), (datetime.date(2018, 1, 6), 'Epiphany'), (datetime.date(2018, 3, 29), 'Holy Thursday'), (datetime.date(2018, 3, 30), 'Good Friday'), (datetime.date(2018, 5, 2), 'Workers Day next monday'), (datetime.date(2018, 5, 16), 'Second Easter monday'), (datetime.date(2018, 7, 25), 'St Santiago - Galicia National Day'), (datetime.date(2018, 8, 15), 'Assumption of Mary to Heaven'), (datetime.date(2018, 10, 12), 'National Day'), (datetime.date(2018, 11, 1), 'All Saints Day'), (datetime.date(2018, 12, 6), 'Constitution Day'), (datetime.date(2018, 12, 8), 'Immaculate Conception'), (datetime.date(2018, 12, 26), 'St Esteban')]