def strfdelta(tdelta, fmt):
    """Format a timedelta object with 'days', 'hours', 'min' and 'sec' placeholders

    Parameters
        tdelta (datetime.timedelta) : timedelta object to format
        fmt (str) : String to format

    Return
        A formatted timedelta object as a string
    """
    data = {"days": tdelta.days}
    data["hours"], rem = divmod(tdelta.seconds, 3600)
    data["min"], data["sec"] = divmod(rem, 60)
    return fmt.format(**data)