hjson module ( https://hjson.org )
the Human JSON
이라는 이름으로 json 파일을 setting 형태로 저장해서 사용 할 때
마지막 항목에 ,를 붙인다던가의 사소한 syntax error는 무시해 주는 확장형 json 입니다.
module간의 interface에서는 굳이 쓸 필요 없을 듯 하고,
주석도 지원해 주기는 하는데 추후 호환성을 위해서는 별로.. 안하는게 좋을듯 합니다.
1.pip로 hjson
설치
C:>pip instsall hjson
2.json과 동일하게 load
d = hjson.load(open('material.json', encoding='utf-8-sig'))
3.json 파일로 write
hson.dumpJSON(d, open('result,json', mode='x'), indent=2)