Skip to content

Latest commit

 

History

History
9 lines (8 loc) · 465 Bytes

File metadata and controls

9 lines (8 loc) · 465 Bytes

csv2dict

read csv and make dictionary
usage :

  1. ret = CSV2Dict.do('unit.csv','unit_id') # unique key csv , filename 'unit.csv' , key name is 'unit_id'
  2. unit_level = CSV2Dict.do_multi_key('upgrade.csv',('unit_id','level')) # multi key csv , key must tuple.
  3. if you want make key int , set make_key_int=True
  4. if header is [] , CSV's first row is header , you can fill custom header , set header=['foo','xxx','aaa']
  5. you can make custom do function.