quantlab.utils.cli.place_downloads#
- quantlab.utils.cli.place_downloads(config, download_dir)[source]#
Return
configwith its raw and watermark directories underdownload_dir.A config factory builds
raw_data_dir_pathas.../<subdir>/<vendor>under the library’s data root. This keeps the vendor directory name and moves it: the result reads and writes<download_dir>/<vendor>and<download_dir>/_watermarks/<vendor>, each of which the acquisition extends with its data type’s directory (crsp_daily,nbbo). Everything an acquisition derives from the raw directory’s parent (the CRSP_reference/and_vintage/directories) therefore lands indownload_dirtoo.- Parameters:
- configAcquisitionConfig
The config a registry
config_factoryreturned.- download_dirstr or os.PathLike
The directory chosen for this run’s downloads.
- Returns:
- AcquisitionConfig
A copy of
configwith the two paths replaced;configitself is unchanged.
Examples
With
cfg.raw_data_dir_pathending inwrds_crsp/wrds:moved = place_downloads(cfg, "/mnt/raw") moved.raw_data_dir_path # '/mnt/raw/wrds' moved.watermark_path # '/mnt/raw/_watermarks/wrds'