| 17 | from finagent.utils.misc import update_data_root |
| 18 | |
| 19 | def parse_args(): |
| 20 | parser = argparse.ArgumentParser(description="Download Prices") |
| 21 | parser.add_argument("--config", default=os.path.join(ROOT, "configs", "downloader", "prices", "fmp_day_prices_exp_cryptos.py"), help="download datasets config file path") |
| 22 | parser.add_argument( |
| 23 | '--cfg-options', |
| 24 | nargs='+', |
| 25 | action=DictAction, |
| 26 | help='override some settings in the used config, the key-value pair ' |
| 27 | 'in xxx=yyy format will be merged into config file. If the value to ' |
| 28 | 'be overwritten is a list, it should be like key="[a,b]" or key=a,b ' |
| 29 | 'It also allows nested list/tuple values, e.g. key="[(a,b),(c,d)]" ' |
| 30 | 'Note that the quotation marks are necessary and that no white space ' |
| 31 | 'is allowed.') |
| 32 | parser.add_argument("--root", type=str, default=ROOT) |
| 33 | parser.add_argument("--workdir", type=str, default="workdir") |
| 34 | parser.add_argument("--batch_size", type=int, default=None) |
| 35 | parser.add_argument("--tag", type=str, default=None) |
| 36 | parser.add_argument("--if_remove", action="store_true", default=False) |
| 37 | args = parser.parse_args() |
| 38 | return args |
| 39 | |
| 40 | class StockDownloaderProcess(multiprocessing.Process): |
| 41 | def __init__(self, stocks, downloader): |