def format_timedelta(time_delta):
    """
    Convert a datetime.timedelta to str format
    example output: "0h:0m:18s"

    Parameters
    ----------
    time_delta: datatime.timedelta

    Returns
    -------
    str: formatted timedelta

    """
    d = {}
    d["hours"], rem = divmod(time_delta.seconds, 3600)
    d["minutes"], d["seconds"] = divmod(rem, 60)
    return "{hours}h:{minutes}m:{seconds}s".format(**d)