Python and obspy examples

You may use Obspy library to natively handle seismic data into your Python scripts.

# this will download 1 hour of data from a FR network station, and display a wafeform plotfrom obspy.fdsn import Client
from obspy import UTCDateTime
client = Client("RESIF")
t = UTCDateTime("2014-01-28T00:00:00.000")
stream = client.get_waveforms("FR", "OGDI", "00", "HHZ", t, t + 60 * 60)


# this will show an inventory for FR network

from obspy.fdsn import Client
client = Client("RESIF")
inventory = client.get_stations(network='FR',level='channel')

You may also request webservices with one of the numerous Python grabber library [5] Unlike Obspy, these libraries are seismic-data agnostic (like wget is):

# this will make a wget-like request and write resulting file on local disk

import urllib2
request = urllib2.Request('')
response = urllib2.urlopen(request)
newfile = open('./mydata.mseed', 'w')
newfile.write ( )

Technically, restricted access works with HTTP digest authentication. Any HTTP client implementing this technology should be able to request restricted-access data.