I am trying to import data from multiple JSON files that have the same structure, into a singular python dictionary, so I can plot it on a line graph in PY. The real problem is that I'm a beginner and only know basics here. The JSON structure is something like this:
{
"ID": "123456",
"data": [
{ "xaxis" : 72, "yaxis" : 0 },
{ "xaxis" : 72.03814, "yaxis" : 0.00222175 },
{ "xaxis" : 72.08051, "yaxis" : 0.0044435},
{ "xaxis" : 72.12288, "yaxis" : 0.008887 },
{ "xaxis" : 72.16102, "yaxis" : 0.00666525 }
]
}
There are around 240 files like this, and what I'd like to do, is have the xaxis and yaxis data in the dictionary, so I can plot with it. Also I'd like to have the "ID" found in each file as, well, the ID of each dataset from each file. The lines should be on one graph from all the files, so one line is one file, so around 240 lines on the graph.
I would highly appreciate any help regarding this topic!
EDIT: The actual problem here seems to be for me to open the multiple json files one-by-one, and appending the data found in them to the dictionaries, I have gotten as far as to create dictionaries with hand-written data, but I don't know where to start with the multiple file openings, and creating a dictionary for each json file. I have found solutions for the other way around (dictionary to json), but not for this case.
How could I feed the code a path, where it can find the json files, go through them, and create a dict for each, in which there would be data as specified above?
Thanks!

pathlibcore library, in particular how you can list files in a folder and get each file content; at last, there is a core library to parse JSON stuff.;-)