def _get_week_period(self):
        dt = datetime.datetime(self.now.year, 1, 1)

        if dt.weekday() > 3:
            dt += datetime.timedelta(7 - dt.weekday())
        else:
            dt -= datetime.timedelta(dt.weekday())

        days = datetime.timedelta((int(self.now.strftime('%V')) - 1) * 7)

        start = (dt + days)
        end = (dt + days + datetime.timedelta(6)).replace(hour=23, minute=59, second=59, microsecond=999999)

        return start.strftime(self.template), end.strftime(self.template)
Returns beginning and an end for a week period.
dataset/ETHPy150Open maxtepkeev/architect/architect/databases/utilities.py/DateTime._get_week_period