MONTH_NUMS = {1: 'January', 2: "February", 3: "March", 4: "April", 5: "May", 6: "June", 7: "July",
                  8: "August", 9: "September", 10: "October", 11: "November", 12: "December"}


class DVD:
    def __init__(self, name, id, creation_year, creation_month, age_restriction):
        self.name = name
        self.id = id
        self.creation_year = creation_year
        self.creation_month = creation_month
        self.age_restriction = age_restriction
        self.is_rented = False

    def __repr__(self):
        return f"{self.id}: {self.name} ({self.creation_month} {self.creation_year})" \
               f" has age restriction {self.age_restriction}. " \
               f"Status: {'rented' if self.is_rented else 'not rented'}"

    @classmethod
    def from_date(cls, id, name, date, age_restriction):
        day, month, year = date.split(".")
        year = int(year)
        month = MONTH_NUMS[int(month)]
        return cls(name, id, year, month, age_restriction)

#month, year = [int(el) for el in date.split(".")[1:]]
# month=datetime.date(year,month,1).strftime('%B')
# from calendar import month_name
MONTH_NUMS = {1: 'January', 2: "February", 3: "March", 4: "April", 5: "May", 6: "June", 7: "July",
                  8: "August", 9: "September", 10: "October", 11: "November", 12: "December"}


class DVD:
    def __init__(self, name, id, creation_year, creation_month, age_restriction):
        self.name = name
        self.id = id
        self.creation_year = creation_year
        self.creation_month = creation_month
        self.age_restriction = age_restriction
        self.is_rented = False

    def __repr__(self):
        return f"{self.id}: {self.name} ({self.creation_month} {self.creation_year})" \
               f" has age restriction {self.age_restriction}. " \
               f"Status: {'rented' if self.is_rented else 'not rented'}"

    @classmethod
    def from_date(cls, id, name, date, age_restriction):
        day, month, year = date.split(".")
        year = int(year)
        month = MONTH_NUMS[int(month)]
        return cls(name, id, year, month, age_restriction)

#month, year = [int(el) for el in date.split(".")[1:]]
# month=datetime.date(year,month,1).strftime('%B')
# from calendar import month_name
#month, year = [int(el) for el in date.split(".")[1:]] # month=datetime.date(year,month,1).strftime('%B') # from calendar import month_name