123456789101112131415161718192021222324252627 |
- # -*- coding: utf-8 -*-
- # @Time : 2023/8/17 14:06
- # @Author : XuJiakai
- # @File : json_utils
- # @Software: PyCharm
- import jsonpath as jp
- def json_path(json: dict, path):
- result = jp.jsonpath(json, path)
- if not result:
- return None
- else:
- return result[0]
- pass
- def del_key(json_obj: dict, key):
- if key in json_obj:
- del json_obj[key]
- return json_obj
- pass
- if __name__ == '__main__':
- pass
|