obspy.io.json.default.Default

class Default(omit_nulls=True, time_format=None)[source]

Bases: object

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

Attributes

OMIT_NULLS

TIME_FORMAT

Special Methods

Default.__call__(obj)[source]

Deal with Event objects in JSON Encoder

This function can be passed to the json module’s default keyword parameter

Default.__delattr__(name, /)

Implement delattr(self, name).

Default.__dir__()

Default dir() implementation.

Default.__eq__(value, /)

Return self==value.

Default.__format__(format_spec, /)

Default object formatter.

Default.__ge__(value, /)

Return self>=value.

Default.__getattribute__(name, /)

Return getattr(self, name).

Default.__gt__(value, /)

Return self>value.

Default.__hash__()

Return hash(self).

Default.__init__(omit_nulls=True, time_format=None)[source]

Create a “default” function for JSONEncoder for ObsPy objects

Parameters
  • omit_nulls (bool) – Leave out any null or empty values (True)

  • time_format (str) – Format string passed to strftime (None)

Default.__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

Default.__le__(value, /)

Return self<=value.

Default.__lt__(value, /)

Return self<value.

Default.__ne__(value, /)

Return self!=value.

Default.__new__(**kwargs)
Default.__reduce__()

Helper for pickle.

Default.__reduce_ex__(protocol, /)

Helper for pickle.

Default.__repr__()

Return repr(self).

Default.__setattr__(name, value, /)

Implement setattr(self, name, value).

Default.__sizeof__()

Size of object in memory, in bytes.

Default.__str__()

Return str(self).

Default.__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).