mirror of
https://github.com/wassname/options_backtester.git
synced 2026-06-27 19:00:03 +08:00
16 lines
349 B
Python
16 lines
349 B
Python
import os
|
|
|
|
|
|
def get_data_dir():
|
|
"""Reads data path from environment variable $OPTIONS_DATA_PATH.
|
|
If it is not set, defaults to `data/`
|
|
"""
|
|
|
|
if "OPTIONS_DATA_PATH" in os.environ:
|
|
data_dir = os.path.expanduser(os.environ["OPTIONS_DATA_PATH"])
|
|
else:
|
|
data_dir = "data"
|
|
os.mkdir(data_dir)
|
|
|
|
return data_dir
|