dump
Serialize data as JSON and write to a file.
def dump(
obj: Any,
fp: IO[str],
kwargs: Any
) - > None
Serialize data as JSON and write to a file. If flask.current_app is available, it will use its app.json.dump() method, otherwise it will use json.dump.
Parameters
| Name | Type | Description |
|---|---|---|
| obj | Any | The data object to be serialized into JSON format. |
| fp | IO[str] | A file-like object opened for writing text, which should use UTF-8 encoding to ensure valid JSON output. |
| kwargs | Any | Additional keyword arguments passed to the underlying JSON dump implementation. |
Returns
| Type | Description |
|---|---|
None | Nothing is returned; the output is written directly to the file pointer. |