Skip to content

Instantly share code, notes, and snippets.

@iluvcapra
Created October 24, 2024 16:46
Show Gist options
  • Save iluvcapra/561271be2feaa3a80b71975d5bac352b to your computer and use it in GitHub Desktop.
Save iluvcapra/561271be2feaa3a80b71975d5bac352b to your computer and use it in GitHub Desktop.
UCS Excel to JSON
import pandas as pd
ucs_ss = pd.read_excel('UCS v8.2.1 Full List.xlsx')
with open('ucs_81.json','w') as fp:
json.dump([{'cat_id': row[3], 'defn': row[5], 'syns': str(row[6]).split(", "), 'vers': '8.2.1'} for row in ucs_ss.itertuples()][2:], fp, indent=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment