def compare_records(new_record, old_record):

    '''
        a method to generate the differences between two data architectures
        
    :param new_record: set, list or dictionary with new details of an item
    :param old_record: set, list or dictionary with old details of an item
    :return: list with dictionary of changes between old and new records
    
    [ { 
        'path': [ 'dict2', 'dict', 'list2', 4, 'key' ],
        'action': 'UPDATE',
        'value': 'newValue'
    } ]
    '''

    if new_record.__class__ != old_record.__class__:
        raise TypeError('Datatype of new and old data must match.')
    from copy import deepcopy
    new_map = deepcopy(new_record)
    old_map = deepcopy(old_record)
    if isinstance(new_map, dict):
        return _compare_dict(new_map, old_map, [], [])
    elif isinstance(new_map, list):
        return _compare_list(new_map, old_map, [], [])
    elif isinstance(new_map, set):
        return _compare_set(new_map, old_map, [], [])
    else:
        raise TypeError('Records must be either sets, lists or dictionaries.')
def compare_records ( new_record , old_record ) : if new_record . __class__ != old_record . __class__ : raise TypeError ( 'Datatype of new and old data must match.' ) from copy import deepcopy new_map = deepcopy ( new_record ) old_map = deepcopy ( old_record ) if isinstance ( new_map , dict ) : return _compare_dict ( new_map , old_map , [ ] , [ ] ) elif isinstance ( new_map , list ) : return _compare_list ( new_map , old_map , [ ] , [ ] ) elif isinstance ( new_map , set ) : return _compare_set ( new_map , old_map , [ ] , [ ] ) else : raise TypeError ( 'Records must be either sets, lists or dictionaries.' )
a method to generate the differences between two data architectures
        
    :param new_record: set, list or dictionary with new details of an item
    :param old_record: set, list or dictionary with old details of an item
    :return: list with dictionary of changes between old and new records
    
    [ { 
        'path': [ 'dict2', 'dict', 'list2', 4, 'key' ],
        'action': 'UPDATE',
        'value': 'newValue'
    } ]