from datetime import date, timedelta


def get_ndays_before_with_format(n, format):
    yesterday = (date.today() + timedelta(days=-n)).strftime(format)
    return yesterday


def get_ndays_before_no_minus(n):
    return get_ndays_before_with_format(n, "%Y%m%d")


def get_ndays_before(n):
    return get_ndays_before_with_format(n, "%Y-%m-%d")
