Evaluating Identity Data Conformity

The identity data when exported from the identity list page shows the extended attribute column as being a list or key / value pair.

Part of validation prior to going live is to confirm that the Identity data conforms to the transforms and rules and the expected results based on the identity types / classification.

To help with this you can use the below python script or something similar to pull this data into a standard CSV where you can see the column header on the first row and not in the value and the the value being in the field.

You can easily sort and see the filtered values do pivot tables, etc.

import csv

def expand_csv_lists(csv_file):
    # Read the CSV file
    with open(csv_file, 'r') as file:
        reader = csv.DictReader(file)
        rows = list(reader)

    # Find the column with dictionaries
    dict_column = None
    for column in reader.fieldnames:
        if ':' in rows[0][column]:
            dict_column = column
            break

    if dict_column is None:
        print("No column with dictionaries found.")
        return

    # Expand the dictionaries into separate columns
    expanded_rows = []
    for row in rows:
        expanded_row = {}
        for key_value in row[dict_column].split(', '):
            if ':' in key_value:
                key_value_split = key_value.split(': ', 1)
                if len(key_value_split) == 2:
                    key, value = key_value_split
                    expanded_row[key.strip()] = value.strip()
                else:
                    key = key_value_split[0]
                    expanded_row[key.strip()] = None
        expanded_rows.append(expanded_row)

    # Update the header
    header = reader.fieldnames.copy()
    header.remove(dict_column)
    for row in expanded_rows:
        for key in row.keys():
            if key not in header:
                header.append(key)

    # Write the expanded data to a new CSV file
    expanded_csv_file = f"expanded_{csv_file}"
    with open(expanded_csv_file, 'w', newline='') as file:
        writer = csv.DictWriter(file, fieldnames=header)
        writer.writeheader()
        writer.writerows(expanded_rows)

    print(f"Expanded data written to {expanded_csv_file}.")

# Usage example
expand_csv_lists("clean.csv")

Please feel free to expand or enhance and re-share.

Ideally, I would love to see this built into the UI.