This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 | |
import datetime | |
def dob_from_pesel(pesel): | |
# based on http://dev.cdur.pl/Artykuly/Pobieranie-daty-urodzenia-i-plci-z-numeru-PESEL-Javascript | |
year = 1900 + int(pesel[0:2]) | |
if 2 <= int(pesel[2]) < 8: | |
year += (int(pesel[2]) / 2) * 100 | |
if int(pesel[2]) >= 8: | |
year -= 100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import date, timedelta | |
from dateutil import easter | |
from dateutil.relativedelta import * | |
def get_holidays(year=2010): | |
""" Returns Polish hollidays dates (legally considered non-working days) """ | |
easter_sunday = easter.easter(year) | |
holidays = {'New Year': date(year,1,1), | |
'Trzech Kroli': date(year,1,6), | |
'Easter Sunday': easter_sunday, |