obspy.io.json.core._write_json

_write_json(obj, filename, omit_nulls=False, pretty_print=True, **kwargs)[source]

Write object to a file in JSON format

Parameters:
  • obj (event class object) – The ObsPy Event-type object to write.

  • filename (str or file) – Filename to write or open file-like object.

  • omit_nulls (bool) – Don’t include empty-valued attributes

  • pretty_print (bool) – Indent for readability

Note

This function is registered via the write() method of an ObsPy Catalog object, but is also valid for any obspy event-type object (or any serializable python object that contains an obspy event-type object)