from fontTools.ttLib import TTCollection
from pathlib import Path
import json
c=TTCollection(Path(__file__).parent/'two-faces.ttc');r=[]
for i,f in enumerate(c.fonts):
 r.append({'index':i,'family':f['name'].getDebugName(1),'full_name':f['name'].getDebugName(4),'A_advance':f['hmtx'].metrics[f.getBestCmap()[65]][0]})
assert len(r)==2 and r[0]['family']!=r[1]['family']
print(json.dumps(r,indent=2))
