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

Method _write_json

botasaurus_api/botasaurus_api/__init__.py:37–47  ·  view source on GitHub ↗

Writes data to a JSON file specified by the filename. This method only runs if the create_response_files flag is True. :param filename: The filename for the JSON file to be created. :param data: The data to be written to the file.

(self, filename, data)

Source from the content-addressed store, hash-verified

35 raise ApiException(f"API at {self._api_url} is not running. Please check if the API is up and running.")
36
37 def _write_json(self, filename, data):
38 """
39 Writes data to a JSON file specified by the filename. This method only runs if the create_response_files flag is True.
40
41 :param filename: The filename for the JSON file to be created.
42 :param data: The data to be written to the file.
43 """
44 if self._create_response_files:
45 path = _create_filename(filename)
46 write_json_response(path, data)
47 print(f"View {filename} response at: ./{path}")
48
49 def _make_api_url(self, path):
50 return f"{self._api_url}/{path}"

Callers 9

create_async_taskMethod · 0.95
create_sync_taskMethod · 0.95
create_async_tasksMethod · 0.95
create_sync_tasksMethod · 0.95
get_taskMethod · 0.95
abort_taskMethod · 0.95
delete_taskMethod · 0.95
delete_tasksMethod · 0.95
abort_tasksMethod · 0.95

Calls 2

_create_filenameFunction · 0.85
write_json_responseFunction · 0.85

Tested by

no test coverage detected