dstream_excel.dstream.keepopen package

Submodules

dstream_excel.dstream.keepopen.combine module

dstream_excel.dstream.keepopen.combine.combine_all_datastream_csv(infolder, outpath='all_data.csv', restart=False)[source]

Combine populated data in csv files into single csv file. This is normally run as a part of download_datastream(), but if for some reason your CSV files don’t get combined at the end, or you want to combine them to see a test sample while the download is still running, then you can run this manually.

Parameters
  • infolder (str) – Folder containing populated csv files

  • outpath (str) – Full file path to output csv to

  • restart (bool) – Whether to force a restart of combining files. If the process is stopped, it will be continued where it left off if restart=False, and start from the beginning if restart=True.

Returns

None

dstream_excel.dstream.keepopen.download module

dstream_excel.dstream.keepopen.download.download_datastream_save_to_csvs(symbols, variables, out_folder='inprogress', num_symbols_per_call=50, restart=False, **ds_func_kwargs)[source]

Opens a workbook if necessary, then repeatedly switches out Datastream function, saves the values in a csv, then goes to next Datastream function.

Parameters
  • symbols (Sequence[str]) – Datastream symbols representing companies. Available by selecting a list through filters in Eikon, then getting an output of that list.

  • variables (Sequence[str]) – Time-series variables to download

  • out_folder (str) – Folder in which in process XLSX files will be generated

  • num_symbols_per_call (int) – Number of firms to gather in one pull. Setting this higher should speed up data collection, but may also make it less stable. If many variables and a longer history is being pulled, a smaller number may be necessary.

  • restart (bool) – Whether to force a restart of download. If the process is stopped, it will be continued where it left off if restart=False, and start from the beginning if restart=True.

  • ds_func_kwargs – can pass begin, end, or freq. All of these arguments take day, month, and year as D, M, and Y. freq can be set to D, M, or Y. begin and end can be set to just Y but combined with a time modifier, e.g. begin=’-5Y’. Don’t pass end to have the data go up to current.

Returns

None

dstream_excel.dstream.keepopen.excel module

dstream_excel.dstream.keepopen.excel.get_empty_ws()[source]

dstream_excel.dstream.keepopen.extract module

dstream_excel.dstream.keepopen.extract.firm_dfs_from_multi_firm_df(multi_firm_df, symbols, num_variables)[source]
dstream_excel.dstream.keepopen.extract.get_multi_firm_df_from_sheet(ws, table_start_range='A1', retries=3)[source]
dstream_excel.dstream.keepopen.extract.long_firm_df_from_ds_multi_firm_df(multi_firm_df, symbols, num_variables)[source]

dstream_excel.dstream.keepopen.wait module

dstream_excel.dstream.keepopen.wait.wait_for_datastream_result(ws)[source]

Module contents