data.fetch_data.get_data_home

data.fetch_data.get_data_home(data_home=None)

Return the location where datasets are to be stored. By default the data directory is set to a folder named ‘spotforecast2_data’ in the user home folder. Alternatively, it can be set by the ‘SPOTFORECAST2_DATA’ environment variable or programmatically by giving an explicit folder path. The ‘~’ symbol is expanded to the user home folder. If the folder does not already exist, it is automatically created.

Parameters

Name Type Description Default
data_home str or pathlib.Path The path to spotforecast data directory. If None, the default path is ~/spotforecast2_data. None

Returns

Name Type Description
data_home pathlib.Path The path to the spotforecast data directory.

Examples

from spotforecast2_safe.data.fetch_data import get_data_home
from pathlib import Path
get_data_home()
get_data_home(Path('/tmp/spotforecast2_data'))
PosixPath('/tmp/spotforecast2_data')