Hi,
I'm trying to pull data via the python Datastream api as a replacement for the excel plugin. In excel, there is an option to specify datatype and different datatypes change the time series output entirely. I was wondering how I might do that via the python api?
An example for time series TOTMKCN on 2020 Q2 and Q3 data is in the attached photos.
Datatype DWNP:
Datatype DWSE:
Thanks,
Assuming you're using DatastreamDSWS library, you can utilize the same mnemonics and datatypes you use in =DSGRID worksheet function in Excel, e.g.
ds.get_data ('TOTMKCN',['DWNP', 'DWSE'], start='-1Y', freq='Q')
Does this answer your question?
Thanks Alex. Helpful as always!
Just wanted to add the parameter names here as well in case anyone else is wondering.
ds = DSWS.Datastream(username=DSWS_login, password=DSWS_pswd) df = ds.get_data(tickers="TOTMKCN", fields=['DWNP', 'DWSE'], start=start_date.strftime("%Y-%m-%d"), freq='M')
where start_date is a datetime object.
Thanks again!