obspy.clients.seedlink.easyseedlink.create_client
- create_client(server_url, on_data=None, on_seedlink_error=None, on_terminate=None)[source]
Quickly create an EasySeedLinkClient instance.
Example
>>> from obspy.clients.seedlink.easyseedlink import create_client >>> def handle_data(trace): ... print('Received new data:') ... print(trace) ... print() ... >>> client = create_client('geofon.gfz-potsdam.de', ... handle_data) >>> client.select_stream('BW', 'MANZ', 'EHZ') >>> client.run()
Note
The methods passed to the
create_client()
function are not bound to the client instance, i.e. they do not have access to the instance via theself
attribute. To get a bound method, the client class can be subclassed and the method overridden.- Parameters
server_url (str) – The SeedLink server URL
on_data (callable) – A function or callable that is called for every new trace received from the server; needs to accept one argument (the trace); default is
None
on_seedlink_error (callable) – A function or callable that is called when a SeedLink ERROR response is received (see the
on_seedlink_error()
method for details); default isNone
on_terminate (callable) – A function or callable that is called when the connection is terminated (see the
on_terminate()
method for details); default isNone