import json,sqlite3,re
from jsonpath_ng import jsonpath
from jsonpath_ng.ext import parse
datapath = '/Users/mac/Documents/DSA Project/Resources/game_data_in_dsa.json'
with open(datapath, 'r') as ofile:
data = json.load(ofile)
main_path = "$.units.[0].ID"
for match in parse(main_path).find(data):
print(f'Path:{match.path}\nFull Path: {match.full_path}\n') #Value: {match.value}')
version 1.5.3 given this code:
my query returns the error:
In the original file there are many instances like I provided and when I go with wildcard It works fine and I can go for each one