import json, os
from collections import Counter
D = os.path.expanduser('~/Desktop/Hermes输出-工作类/数据')
c = json.load(open(f'{D}/mcp_customers.json'))
print('customers updated_at=', c.get('updated_at'), 'n=', len(c['customers']))
a = json.load(open(f'{D}/daily_activities_mcp.json'))
print('activities updated=', a.get('updated'), 'total=', a.get('total'))
mc = Counter((i.get('start_time') or '')[:7] for i in a['items'])
print('activity months:', dict(sorted(mc.items())))
k = json.load(open(f'{D}/kpi_progress.json'))
print('kpi_progress', k.get('month'), k.get('total'), k.get('updated_at'))
for f in ['mcp_complaints.json','mcp_customers.json','daily_activities_mcp.json','mcp_orders_input.json','workbench_data.json','shipment_status.json']:
    p = f'{D}/{f}'
    import time
    print(f, time.strftime('%H:%M:%S', time.localtime(os.stat(p).st_mtime)), os.path.getsize(p))
