printjson#

printjson(obj, indent=2, **kwargs)[source]#

Print an object as a JSON

Acts as an alias to print(sc.jsonify(..., tostring=True)).

Parameters:
  • obj (any) – the object to print

  • indent (int) – the level of indent to use

  • kwargs (dict) – passed to sc.jsonify()

Example:

data = dict(a=dict(x=[1,2,3], y=[4,5,6]), b=dict(foo='string', bar='other_string'))
sc.printjson(data)

New in version 3.0.0.