MCPcopy Index your code
hub / github.com/omkarcloud/botasaurus / write_json

Function write_json

botasaurus/cache.py:21–27  ·  view source on GitHub ↗
(data, path)

Source from the content-addressed store, hash-verified

19 return os.path.dirname(file_path)
20
21def write_json(data, path):
22 try:
23 with open(path, 'w', encoding="utf-8") as fp:
24 json.dump(data, fp)
25 except FileNotFoundError:
26 create_directory_if_not_exists(get_directory_path(path))
27 return write_json(data, path)
28
29
30def getfnname(func):

Callers 4

save_cached_taskMethod · 0.90
save_taskMethod · 0.90
_putFunction · 0.70
putMethod · 0.70

Calls 2

get_directory_pathFunction · 0.85

Tested by

no test coverage detected