i am running the following code
ds.get_data(tickers='<.HSI>', fields=['PI','PE'], kind=0)
i keep getting ds is not defined error. no issues if i use ek. but i want to pull data from ds
Thanks for reaching out to us.
You need to import the DatastreamPy package, set a username and password, and then call that function.
import DatastreamPy as DSWS ds = DSWS.Datastream(username = "<username>", password = "<password>) ds.get_data(tickers='<.HSI>', fields=['PI','PE'], kind=0)
The DatastreamPy library is available at https://pypi.org/project/DatastreamPy/.
The output is:
I hope that this information is of help.
@Jirapongse thank you very much for your quick response. Can i check with you for the username and password is there any way i can store it in a notepad and then retreive it with a config parser, just like the method in eikon? i am hoping to not have to put the username and password explicitly in the codebook but rather have it read from a notepad so that username and password is not exposed. Thank you