'Parse a date and return a `Period` object or `None` if the
string is empty.'

@classmethod
def parse(cls, string):

    if (not string):
        return None
    ordinal = string.count('-')
    if (ordinal >= len(cls.date_formats)):
        return None
    date_format = cls.date_formats[ordinal]
    try:
        date = datetime.strptime(string, date_format)
    except ValueError:
        return None
    precision = cls.precisions[ordinal]
    return cls(date, precision)
