data = ['only', 'lists', [1, 2, 3], 'dictionaries', {'a': 0, 'b': 1},
    'numbers', 47, 'strings']
data_md5 = hashlib.md5(json.dumps(data, sort_keys=True)).hexdigest()
print(data_md5)
Computing an md5 hash of a data structure