def safe_col_name(args_pair):
    """Ensure that the column name is safe for SQL (unique value, no spaces, no trailing punctuation).

    Typically called with `df.columns = [*map(safe_col_name, enumerate(df.columns.to_list()))]`

    Args:
        args_pair: tuple of arguments from map function in `(idx, col)`

    Returns:
        string: safely formatted string for SQLite

    """
    idx, col = args_pair
    col = col.strip().replace(' ', '_').replace('.', '_').replace(',', '_')
    return str(idx) if col == '' else col