17 lines
570 B
Python
17 lines
570 B
Python
import sys
|
|
sys.stdout.reconfigure(encoding='utf-8')
|
|
import json
|
|
|
|
d = json.load(open(r"C:\Users\Idiot\Desktop\temp\sample.json", "r", encoding="utf-8"))
|
|
print("Top keys:", list(d.keys()))
|
|
print("Data type:", type(d.get("Data")))
|
|
|
|
data_val = d.get("Data")
|
|
if isinstance(data_val, str):
|
|
print("Data is a string, trying to parse...")
|
|
parsed = json.loads(data_val)
|
|
print("Parsed Data keys:", list(parsed.keys()))
|
|
elif isinstance(data_val, dict):
|
|
print("Data keys:", list(data_val.keys()))
|
|
print("prism_tablesInfo exists:", "prism_tablesInfo" in data_val)
|