mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-03 07:51:49 +00:00
* modify path for etf, options, insider * fix small * change path for stocks screener * fix flake 8 * remove preset_path * black * fix * fix tests * fix tests * fix flake8 * change paths_helper load * put ns parser back Co-authored-by: minhhoang1023 <40023817+minhhoang1023@users.noreply.github.com>
34 lines
1.1 KiB
Python
34 lines
1.1 KiB
Python
# IMPORTATION STANDARD
|
|
from pathlib import Path
|
|
import os
|
|
import dotenv
|
|
|
|
|
|
def get_user_data_directory():
|
|
""" "
|
|
Gets user data path from .env file
|
|
"""
|
|
dotenv.load_dotenv(USER_ENV_FILE)
|
|
if os.getenv("OPENBB_USER_DATA_DIRECTORY"):
|
|
user_data_directory = Path(os.getenv("OPENBB_USER_DATA_DIRECTORY"))
|
|
else:
|
|
user_data_directory = Path.home() / "OpenBBUserData"
|
|
return user_data_directory
|
|
|
|
|
|
HOME_DIRECTORY = Path.home()
|
|
REPOSITORY_DIRECTORY = Path(__file__).parent.parent.parent.parent
|
|
SETTINGS_DIRECTORY = HOME_DIRECTORY / ".openbb_terminal"
|
|
REPOSITORY_ENV_FILE = REPOSITORY_DIRECTORY / ".env"
|
|
USER_ENV_FILE = SETTINGS_DIRECTORY / ".env"
|
|
|
|
USER_DATA_DIRECTORY = get_user_data_directory()
|
|
|
|
USER_EXPORTS_DIRECTORY = USER_DATA_DIRECTORY / "exports"
|
|
|
|
CUSTOM_IMPORTS_DIRECTORY = USER_DATA_DIRECTORY / "custom_imports"
|
|
PORTFOLIO_DATA_DIRECTORY = USER_DATA_DIRECTORY / "portfolio"
|
|
ROUTINES_DIRECTORY = USER_DATA_DIRECTORY / "routines"
|
|
DATA_SOURCES_DEFAULT_FILE = USER_DATA_DIRECTORY / "data_sources_default.json"
|
|
PRESETS_DIRECTORY = USER_DATA_DIRECTORY / "presets"
|