mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-29 05:21:48 +00:00
* start papermill rollback * move reports to templates folder * comment some stuff * refactor reports controller * change var names * clean ctrl class vars * small refactoring on metadata search * relocate some func * breaking changes * revert some changes * destroying changes * change menu appearance * change menu appeaerance again * update choices * change some assets locations * remove unused vars * change some docstrings * rename vars * its working * forgot one dash * omg its working * clean some code and doc * change func name * fix a bug and add some comments * fix economy report startup * add custom reports * allow custom reports * forgot to delete this * unused import * make somestuff more explicit, 5 min rule * add helper func * supress errors--no-verify * add some type checks * fix check ipynb func * check inputs in run * rewrite some integration tests * remove unused import * add some docs to website * add auto completion * warn if no forecast * add to do * add arg name if 1 arg * add papermill pointing to github main * add notebooks * fix terminal spec * relocated choices files * merge main * relocate website docs for reports * limit user choices * fix portfolio auto completion * limit choices fix * clean som edocstrings * limit user choices in run command * improve run parser * fix msg * add reports controller tests * relax crypto choices limit * contain commands * pass pre commit * flake8 * flake8 * ignore mypy * pylint * website * move docs to jupyter tab * add installer dep * remove etf * remove reports * update reports to main * handle events erros * rever reports to previous commits before main merge * add papermill installer strategies * add flags to terminal * avoid sdk crash * execute notebook in thread * remove unused sys * execute report in a child process * fix some notebook stuff * fix portfolio report * fix reports controller volatility * change api to sdk * move images * remove som unucessary installer imports * remove debugger warning * move ipykernel launcher * supress notebook crash * remove portfolio decorator * fix run command * forgot to change this * add images * fix portfolio report * fix crypto report * linting and tests * add run integration test * pylint * hide reports module args * try at supressing args * try at supreccing warning * solve some os issues * handle pm errors * fix warning unrecognized arguments * change comment * avoid crash when parameters not found * fix etf commands * minor cleanup * update forecasting check * fix some linting * fix futures test * pylint * limit user choices to prompt * limit user choices to prompt * supress warnings * revert poetry lock back to main * papermill pointing to main * flake8 * forgot requirements * Update helper_funcs.py * Update reports_model.py * choices Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: James Simmons <53658028+simmonsj330@users.noreply.github.com>
37 lines
1.4 KiB
Python
37 lines
1.4 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
|
|
PACKAGE_DIRECTORY = Path(__file__).parent.parent.parent
|
|
MISCELLANEOUS_DIRECTORY = PACKAGE_DIRECTORY / "miscellaneous"
|
|
REPOSITORY_ENV_FILE = REPOSITORY_DIRECTORY / ".env"
|
|
PACKAGE_ENV_FILE = PACKAGE_DIRECTORY / ".env"
|
|
|
|
SETTINGS_DIRECTORY = HOME_DIRECTORY / ".openbb_terminal"
|
|
USER_ENV_FILE = SETTINGS_DIRECTORY / ".env"
|
|
USER_DATA_DIRECTORY = get_user_data_directory()
|
|
USER_EXPORTS_DIRECTORY = USER_DATA_DIRECTORY / "exports"
|
|
USER_CUSTOM_IMPORTS_DIRECTORY = USER_DATA_DIRECTORY / "custom_imports"
|
|
USER_PORTFOLIO_DATA_DIRECTORY = USER_DATA_DIRECTORY / "portfolio"
|
|
USER_ROUTINES_DIRECTORY = USER_DATA_DIRECTORY / "routines"
|
|
USER_DATA_SOURCES_DEFAULT_FILE = USER_DATA_DIRECTORY / "data_sources_default.json"
|
|
USER_PRESETS_DIRECTORY = USER_DATA_DIRECTORY / "presets"
|
|
USER_REPORTS_DIRECTORY = USER_DATA_DIRECTORY / "reports"
|
|
USER_CUSTOM_REPORTS_DIRECTORY = USER_DATA_DIRECTORY / "reports" / "custom reports"
|