def to_dict(object_):
    return dict((p.key, p.value) for p in object_)
result = [{'transaction': to_dict(object_)} for object_ in parse(data)]
print(json.dumps(result))
Преобразование массива JavaScript в JSON с помощью Python