import zipfile, json, sys z = zipfile.ZipFile(r'E:/cfc/docs/参考资料/publish/_pkg-socratic-coach.zip') names = z.namelist() for n in names: print(n) print('--- total', len(names), 'entries ---') bad = [n for n in names if '.bak' in n or n.endswith('.pyc') or '__pycache__' in n] print('DIRTY:', bad) if bad else print('CLEAN') kb_name = [n for n in names if n.endswith('统一知识库.json')][0] d = json.loads(z.read(kb_name).decode('utf-8')) print('KB version:', d.get('version'), '| estrogen:', '雌激素水平' in json.dumps(d, ensure_ascii=False)) md_name = [n for n in names if n.endswith('socratic-coach.md')][0] md = z.read(md_name).decode('utf-8') print('MD has 2.0 gate:', '2.0 归因硬门槛' in md) print('MD refs question-template:', '菌群问诊清单模板' in md) print('MD refs delivery-template:', '交付模板' in md) print('MD has fingerprint-check:', '路由自检' in md) print('MD has rubric-6.2.1:', '6.2.1' in md) tpl = [n for n in names if '问诊清单模板' in n or '交付模板' in n] print('new templates in pkg:', tpl) pj_name = [n for n in names if n.endswith('plugin.json')][0] pj = json.loads(z.read(pj_name).decode('utf-8')) print('plugin version:', pj.get('version')) import os print('size KB:', round(os.path.getsize(r'E:/cfc/docs/参考资料/publish/_pkg-socratic-coach.zip') / 1024, 1))