# Connectin seedlink

**URL:** https://discourse.obspy.org/t/connectin-seedlink/863
**Category:** Users Mailing List Archive
**Tags:** archive
**Created:** [December 26, 2019, 2:20pm UTC](https://discourse.obspy.org/t/connectin-seedlink/863 "2019-12-26T14:20:54Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Recai\_F\_KARTAL](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@Recai\_F\_KARTAL](https://discourse.obspy.org/u/Recai_F_KARTAL)
#### Post date: [December 26, 2019, 2:20pm UTC](https://discourse.obspy.org/t/connectin-seedlink/863/1 "2019-12-26T14:20:54Z")

</div>

_Dear Authorized,_

_I have a question related to seedlink connection._

_My connection code is below:_

from obspy.clients.seedlink.easyseedlink import \*

def handle\_data(trace):  
print(trace.stats.station)  
print(trace.stats.endtime)

client = create\_client(‘[remote.org:18000](http://remote.org:18000)’, handle\_data)

station = ‘ABC’

net = ‘CD’  
client.select\_stream(net, station, ‘EL?’)  
client.run()

_My goal is to connect to the seedlink server and do station query. I’m linking with the code above. But I can’t get a return from handle\_data._

_If the station is coming to the seedlink server, I want to do the same query for another station after reading the end time and receiving this information._

_How can do it? can you help me?_

_Best regards,_

_Recai._

---

<div class="post-metadata">

### Author: ![megies](https://discourse.obspy.org/user_avatar/discourse.obspy.org/megies/32/9_2.png) [@megies](https://discourse.obspy.org/u/megies)
#### Post date: [January 9, 2020, 3:05pm UTC](https://discourse.obspy.org/t/connectin-seedlink/863/2 "2020-01-09T15:05:07Z")

</div>

Hi Recai,

did you have a look at this example?

> **[obspy.clients.seedlink.easyseedlink.EasySeedLinkClient — ObsPy 1.4.2...](https://docs.obspy.org/packages/autogen/obspy.clients.seedlink.easyseedlink.EasySeedLinkClient.html)**

You would have to parse that xml string yourself, though, but that should be simple.  
There's also this page for the easyseedlink client:

> **[obspy.clients.seedlink.easyseedlink.EasySeedLinkClient — ObsPy 1.4.2...](https://docs.obspy.org/packages/autogen/obspy.clients.seedlink.easyseedlink.EasySeedLinkClient.html)**

If you're able to use the current development version of obspy, a convenience routine implemented for the basic client, but thats not in the stable release yet:

> **[obspy.clients.seedlink.basic\_client.Client.get\_info — ObsPy...](https://docs.obspy.org/master/packages/autogen/obspy.clients.seedlink.basic_client.Client.get_info.html)**

The code parsing the xml response is here, in case you need it:

> <https://github.com/obspy/obspy/pull/2405/files#diff-0eb620aa1b2af06568b44a7b57bc1c04R283>
>
> \### What does this PR do?
> 
> Adds a method to seedlink client to be able to fetc…h a list of network/stations for which waveform streams are provided.
> 
> \### Why was it initiated? Any relevant Issues?
> 
> This can help in applications to resolve wildcards in stations/networks, e.g. when using \`seedlink-plotter\` with \`"GR\_\*:HHZ"\` as seedlink string because the realtime version of the seedlink client can not handle wildcards in network/station.
> 
> \### PR Checklist
> \- \[x\] Correct base branch selected? \`master\` for new features, \`maintenance\_...\` for bug fixes
> \- \[x\] This PR is not directly related to an existing issue (which has no PR yet).
> \- \[\] If the PR is making changes to documentation, docs pages can be built automatically.
> Just remove the space in the following string after the + sign: "+ DOCS"
> \- \[x\] If any network modules should be tested for the PR, add them as a comma separated list
> (e.g. \`clients.fdsn,clients.arclink\`) after the colon in the following magic string: "+TESTS:clients.seedlink"
> (you can also add "ALL" to just simply run all tests across all modules)
> \- \[\] All tests still pass.
> \- \[x\] Any new features or fixed regressions are be covered via new tests.
> \- \[x\] Any new or changed features have are fully documented.
> \- \[x\] Significant changes have been added to \`CHANGELOG.txt\` .
> \- \[x\] First time contributors have added your name to \`CONTRIBUTORS.txt\` .

best,  
Tobias

---

<div class="post-metadata">

### Author: ![Recai\_F\_KARTAL](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@Recai\_F\_KARTAL](https://discourse.obspy.org/u/Recai_F_KARTAL)
#### Post date: [January 10, 2020, 7:36am UTC](https://discourse.obspy.org/t/connectin-seedlink/863/3 "2020-01-10T07:36:04Z")

</div>

Dear Tobias,

Thank you very much for answering my question.

Yes, I’ve tried everything you’ve suggested. I didn’t get any results, so I asked for help. I use opspy version 1.1.1. It has not “obspy.clients.seedlink.basic\_client.Client.get\_info” on this version.

My goal is to check the stations come to seedlink server one by one. I writed code for this. it is below.

from obspy.clients.seedlink.easyseedlink import \*  
import pymysql

def handle\_data(trace):  
networkCode = trace.stats.network  
channel = trace.stats.channel  
station = trace.stats.station  
print(trace.stats.station)  
print(trace.stats.channel)  
print(trace.stats.endtime)

```python

```
