question

Upvotes
Accepted
29 2 6 12

DSWS guide & other questions

Hi team, a few questions regarding DSWS:

1. Which python package is the official and will be continue supported one, DatastreamDSWS or pydatastream?

2. I tried (DatastreamDSWS) df = ds.get_data(tickers='VOD,BARC', fields=['PH','PL'], start= '-2D', retName = True) but got error below:

TypeError: get_data() got an unexpected keyword argument 'retName'

May i know the reason?

3. May I know any detailed instruction or user guide for DSWS? The ones in my.refinitiv.com or developer community seems too simple. Some questions like how to get unit/date/explanation/source/meaning of retrieved value are not mentioned in the user guide, and i don't know where to find them since it's not mentioned in navigator as well.

Thanks in advance.

#technologyapidatastream-apidsws-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
86.2k 292 53 78

@Julian.Bai

I can't find an official document regarding DatastreamPy. You can contact the Product team directly via MyRefinitiv to confirm this.

You can use the |N suffix to get the return name.

df = ds.get_data(tickers='VOD|N, U:IBM|N',fields=['EPS1TR12'],
                 kind=0)
df

The output is:

1676273993946.png

Regarding the "pip install" command, it may be blocked by the proxy or firewall (Zscaler). You can try the following options when running the pip command.

--trusted-host pypi.python.org --trusted-host pypi.org --trusted-host files.pythonhosted.org 

Otherwise, please contact the Zscaler team to whitelist these names.

The DatastreamPy library may not be available in Conda.

According to the Exception("Invalid JSON Date"), it could be a bug in the API. I can replicate the problem too.

1676274129450.png

Please report this issue to the Product team (Refinitiv Datastream Web Service) directly via MyRefinitv.


1676273993946.png (15.0 KiB)
1676274129450.png (20.4 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thank you very much!
Upvotes
86.2k 292 53 78

@Julian.Bai

Thanks for reaching out to us.

1. It is DatastreamPy which is a rebranded version of DatastreamDSWS. They are linked to the same GitHub. Therefore, you need to use DatastreamPy which is supported by Refinitiv.

2. According to the source code, it doesn't support the retName argument anymore.

def get_data(self, tickers, fields=None, start='', end='', freq='', kind=1):
        """This Function processes a single JSON format request to provide
           data response from DSWS web in the form of python Dataframe

3. The Datastream Navigator is a good tool to search for content and description. However, if you are unable to find it in the Datastream Navigator, you can contact the Datastream support team directly via MyRefinitiv.

I hope that this information is of help.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi mate, thanks for replying. Following up questions:

1. Is this change an official one? When will that be announced and changed in the official user guide & docs? It's still branding DatastreamDSWS.

2. Then are we able to get field names, like retName's function?

3. Understood, thank you.

Besides, I tried pip install DatastreamPy and got the error "HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)'))) - skipping"

and conda install DatastreamPy got the error "

PackagesNotFoundError: The following packages are not available from current channels:


- datastreampy


Current channels:


- https://repo.anaconda.com/pkgs/main/win-64

- https://repo.anaconda.com/pkgs/main/noarch

- https://repo.anaconda.com/pkgs/r/win-64

- https://repo.anaconda.com/pkgs/r/noarch

- https://repo.anaconda.com/pkgs/msys2/win-64

- https://repo.anaconda.com/pkgs/msys2/noarch


To search for alternate channels that may provide the conda package you're

looking for, navigate to


https://anaconda.org


and use the search bar at the top of the page.

"

1 more q: i tried usage check function and got error

df = ds.get_data(tickers='STATS', fields=['DS.USERSTATS'], kind=0)

raise Exception("Invalid JSON Date")

Exception: Invalid JSON Date

May i know the reason as well? Thank you.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.