#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
import os

ROOT = os.path.expanduser('~/Desktop/Hermes输出-工作类')
for fn in ['数据/daily_activities_mcp.json', '数据/mcp_complaints.json', '数据/customer_360.json']:
    p = os.path.join(ROOT, fn)
    if not os.path.exists(p):
        print('!!', p)
        continue
    d = json.load(open(p, encoding='utf-8'))
    print('=' * 90)
    print(fn, type(d).__name__, 'size=%.1fMB' % (os.path.getsize(p) / 1e6))
    if isinstance(d, dict):
        for k, v in d.items():
            n = len(v) if hasattr(v, '__len__') else ''
            print('   key=%s type=%s len=%s' % (k, type(v).__name__, n))
            if isinstance(v, list) and v and isinstance(v[0], dict):
                print('      sample keys:', list(v[0].keys()))
                s = json.dumps(v[0], ensure_ascii=False)
                print('      sample:', s[:600])
