🧪 Version 0.3.1 is our alpha release candidate. Please send us bug reports and suggestions!

Sketchingpy

Creative coding and interactive science everywhere for everyone: web, desktop, mobile, Jupyter, and more. Open source!

Reference for write_json

Write a JSON file. This is part of the reference section.

Purpose

Write a JSON file, saving it to local file system or offering it as a download in the browser.

Snippet

Write a simple dictionary to example.json.
record = {'group': 'a', 'value': 1}
sketch.get_data_layer().write_json(records, 'example.json')

Parameters

  • record: The value to write as JSON.
  • path: The location at which the file should be written.

Examples

Availability

Available for all platforms. On static and app renderers, will interpret path as a local file path using the operating system's conventions. For web, it will interpret path as a filename to use when dowloading the result.

See also