import pandas as pd
from odhpy import utils

def read_ts_csv(filename, date_format=r"%d/%m/%Y", **kwargs):
    """Reads a daily timeseries csv into a DataFrame, and sets the index to the Date.
    Assumed there is a column named "Date"

    Args:
        filename (_type_): _description_
        date_format (str, optional): defaults to "%d/%m/%Y" as per Fors. Other common formats include "%Y-%m-%d", "%Y/%m/%d".

    Returns:
        _type_: _description_
    """
    df = pd.read_csv(filename, **kwargs)
    df = utils.set_index_dt(df, format=date_format)
    return df