-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathverify.py
33 lines (25 loc) · 878 Bytes
/
verify.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import json
o = 'marketplace_old.json'
n = 'marketplace_new.json'
odata = []
ndata = []
integris_count = 0
def search(ins_id, name, data):
return [element for element in data if element['id'] == ins_id and element['meta']['name'] == name]
with open(o, 'r') as file:
odata = json.load(file)
with open(n, 'r') as file:
ndata = json.load(file)
for datapoint in odata:
result = search(datapoint['id'], datapoint['meta']['name'], ndata)
if len(result) == 1:
#print('Verified '+datapoint['id'])
integris_count+=1
else:
print(f'Unaccounted {datapoint["meta"]["name"]} {datapoint["id"]}')
print('')
print(f'Old data inscriptions: {len(odata)}')
print(f'New data matched: {integris_count}')
print(f'New data total inscriptions: {len(ndata)}')
if (len(odata) == integris_count):
print(f'New data is good, added inscriptions: {(len(ndata)-len(odata))}')