obspy/obspy — pull request #670 by markcwill (2013-10-30 00:33:19+00:00)
Title: JSON serialization support for event objects

I've been doing some message queue testing using JSON serialization, and thought I'd throw this out there. The functions for the python `json` module accept a `default` function to encode non-builtin types, so here's one for ObsPy event objects. Useful for passing Events or Origins to a language that doesn't have QuakeML support yet, size is smaller than XML, and easy to store in a JSON-like database i.e. mongoDB

It could be expanded to Trace objects, but with something like `zmq`, it would be more efficient to use the buffer interface to pass numpy arrays than serializing to JSON. Might also try a decoder function too, but it would be trickier.

Let me know what you think. I just put it in `obspy.core` for now, b/c that's where `quakeml` is...