obspy.io.json.default

JSON Encoder default function

This module provides:

Default : a class to create a “default” function accepted by the python json module Encoder classes, valid for Event objects.

Example

>>> import json
>>> from obspy import read_events
>>> from obspy.io.json.default import Default
>>> c = read_events()
>>> d = Default(omit_nulls=False)
>>> s = json.dumps(c, default=d)

Classes

Default

Class to create a "default" function for the json.dump()/json.dumps() functions which is passed to the JSONEncoder.