You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
8 lines
472 B
8 lines
472 B
import json, sys
|
|
sys.stdout.reconfigure(encoding='utf-8')
|
|
d = json.load(open(r'd:\code\crm-backend-matt\tmp\lanhu_pages_live.json', encoding='utf-8'))
|
|
text = d['result']['content'][0]['text']
|
|
data = json.loads(text)
|
|
print('doc:', data['document_name'], '| total_pages:', data['total_pages'], '| folders:', data.get('folder_statistics'))
|
|
for p in data['pages']:
|
|
print(f"{p['index']:>2} | L{p['level']} | {p['name']} | id={p['id'][:12]} | children={p['has_children']}")
|
|
|