一个为Python服务的JSon Helper
jthon的Python项目详细描述
JTHON
json,但使用lisp。这是一个使处理json文件更容易的实用程序。
安装
pip安装jthon
使用量
importjthona_new_dict={'fruits':{'pineapple':0,'apples':2,'orange':4,'pears':1}}example=jthon.load('fruits',a_new_dict)find=example.find(key='apple',exact=False)forfoundinfind:print("I've found '{}', with a value of '{}'.".format(found.key,found.value))print("{}".format(found.siblings))print("There are {} oranges in the dict!".format(example.get('fruits').get('orange')))example['fruits']['peach']=1example.save()print(example)
更多示例可在examples文件夹中找到
要求
python3 >
作者
许可证
此项目在麻省理工学院授权-有关详细信息,请参见LICENSE文件