mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-28 13:01:38 +00:00
* I missed some sheet_name ones :) * Move quote to main menu and combine yahoo finance commands * Update stocks for quote * First update to move yfinance away from main functionality * Small updates * Update tests to reflect changes * Fix some little things * Update docs a little too * Remove the Due Diligence menu * Update tests for new change * Update fa and stocks with new text and move some stuff around * Bye bye dd * Pls work * work.. * work.. * work.. * Work..| * Add tests back in * Remove tests * Fix fix fix * Remove tests to fix conflicts * Improve the `stocks/search` command (#4084) * Improve search command * Make it more intuitive * Fix tests * Update the docs * Ok done * Ok done 2 * Ok done 3 * Git update tests that failed * Update commands with --sheet-name that didn't work (#4088) * Update commands with --sheet-name that didn't work * Fix test * oops * Adds auto completion to `news` (#4089) * Fix plot look when using eval and add query to choices (#3881) * convert index to datetime and update choices * uncomment economy integration test * fix treasury concat bug * fix datasets concat on duplciates * Lock ruff version so that new lints dont break our CI (#3905) * Lock ruff version so that new lints dont break our CI * Bumped pre-commit ruff version * returning always a dataframe * Revert "returning always a dataframe" This reverts commitd5dbf3132f. * quick fix to auto complete args --------- Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> Co-authored-by: Colin Delahunty <72827203+colin99d@users.noreply.github.com> Co-authored-by: James Maslek <jmaslek11@gmail.com> * Hotfix/Windows-CLI (#4087) * init * Update windows10_build.yml * Update windows10_build.yml * Update windows10_build.yml * Update windows10_build.yml * Update windows10_build.yml * Update windows10_build.yml * oops --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * Adds end date to `forex/load` (#4077) * Fix plot look when using eval and add query to choices (#3881) * convert index to datetime and update choices * uncomment economy integration test * fix treasury concat bug * fix datasets concat on duplciates * Lock ruff version so that new lints dont break our CI (#3905) * Lock ruff version so that new lints dont break our CI * Bumped pre-commit ruff version * returning always a dataframe * Revert "returning always a dataframe" This reverts commitd5dbf3132f. * adding end date to the forex load * added some tests * added example * always show msg * rewriting test * updating tests * updating tests * Redo load tests --------- Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> Co-authored-by: Colin Delahunty <72827203+colin99d@users.noreply.github.com> Co-authored-by: James Maslek <jmaslek11@gmail.com> * Update tests to reflect changes * work.. * Remove tests * Fix fix fix * Remove tests * Update the whole test folder * Small updates * Revert change * Update eodhd to reflect it requires a paid plan and update tests * Fix all the tests * Update tests * Update integration tests * Removing tests so no whining happens * ADD ALL THE TESTS * Fix linting * gitignore. thanks jer * Add back dd and redirect to fa * Update to just display a message * Update OpenBB SDK commands * Fixing issues with exporting * Fix ruff messing up * Fix tests * Fix the tests by disabling isort to run on tests folder --------- Co-authored-by: Jeroen Bouma <jeroenbouma@Jeroens-MacBook-Pro.local> Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> Co-authored-by: Colin Delahunty <72827203+colin99d@users.noreply.github.com> Co-authored-by: teh_coderer <me@tehcoderer.com>
158 lines
4.3 KiB
Python
158 lines
4.3 KiB
Python
# IMPORTATION STANDARD
|
|
import os
|
|
import os.path
|
|
|
|
# IMPORTATION THIRDPARTY
|
|
import i18n
|
|
|
|
from openbb_terminal.base_helpers import load_env_vars, strtobool
|
|
from openbb_terminal.core.config import paths_helper
|
|
|
|
# IMPORTATION INTERNAL
|
|
from openbb_terminal.core.config.paths import (
|
|
MISCELLANEOUS_DIRECTORY,
|
|
USER_DATA_SOURCES_DEFAULT_FILE,
|
|
load_dotenv_with_priority,
|
|
)
|
|
|
|
paths_helper.init_userdata()
|
|
|
|
# pylint: disable=no-member,c-extension-no-member
|
|
|
|
load_dotenv_with_priority()
|
|
|
|
try:
|
|
__import__("git")
|
|
except ImportError:
|
|
WITH_GIT = False
|
|
else:
|
|
WITH_GIT = True
|
|
|
|
|
|
# Always overwrite exported files
|
|
FILE_OVERWITE = load_env_vars("OPENBB_FILE_OVERWRITE", strtobool, False, "featflags")
|
|
|
|
# Retry unknown commands with `load`
|
|
RETRY_WITH_LOAD = load_env_vars("OPENBB_RETRY_WITH_LOAD", strtobool, False, "featflags")
|
|
|
|
# Use tabulate to print dataframes
|
|
USE_TABULATE_DF = load_env_vars("OPENBB_USE_TABULATE_DF", strtobool, True, "featflags")
|
|
|
|
# Use clear console after each command
|
|
USE_CLEAR_AFTER_CMD = load_env_vars(
|
|
"OPENBB_USE_CLEAR_AFTER_CMD", strtobool, False, "featflags"
|
|
)
|
|
|
|
# Use coloring features
|
|
USE_COLOR = load_env_vars("OPENBB_USE_COLOR", strtobool, True, "featflags")
|
|
|
|
# Select console flair (choose from config_terminal.py list)
|
|
USE_FLAIR = str(os.getenv("OPENBB_USE_FLAIR", ":openbb"))
|
|
|
|
# Add date and time to command line
|
|
USE_DATETIME = load_env_vars("OPENBB_USE_DATETIME", strtobool, True, "featflags")
|
|
|
|
# Enable interactive matplotlib mode
|
|
USE_ION = load_env_vars("OPENBB_USE_ION", strtobool, True, "featflags")
|
|
|
|
# Enable watermark in the figures
|
|
USE_WATERMARK = load_env_vars("OPENBB_USE_WATERMARK", strtobool, True, "featflags")
|
|
|
|
# Enable command and source in the figures
|
|
USE_CMD_LOCATION_FIGURE = load_env_vars(
|
|
"OPENBB_USE_CMD_LOCATION_FIGURE", strtobool, True, "featflags"
|
|
)
|
|
|
|
# Enable Prompt Toolkit
|
|
USE_PROMPT_TOOLKIT = load_env_vars(
|
|
"OPENBB_USE_PROMPT_TOOLKIT", strtobool, True, "featflags"
|
|
)
|
|
|
|
# Enable plot autoscaling
|
|
USE_PLOT_AUTOSCALING = load_env_vars(
|
|
"OPENBB_USE_PLOT_AUTOSCALING", strtobool, False, "featflags"
|
|
)
|
|
|
|
# Enable thoughts of the day
|
|
ENABLE_THOUGHTS_DAY = load_env_vars(
|
|
"OPENBB_ENABLE_THOUGHTS_DAY", strtobool, False, "featflags"
|
|
)
|
|
|
|
# Quick exit for testing
|
|
ENABLE_QUICK_EXIT = load_env_vars(
|
|
"OPENBB_ENABLE_QUICK_EXIT", strtobool, False, "featflags"
|
|
)
|
|
|
|
# Open report as HTML, otherwise notebook
|
|
OPEN_REPORT_AS_HTML = load_env_vars(
|
|
"OPENBB_OPEN_REPORT_AS_HTML", strtobool, True, "featflags"
|
|
)
|
|
|
|
# Enable auto print_help when exiting menus
|
|
ENABLE_EXIT_AUTO_HELP = load_env_vars(
|
|
"OPENBB_ENABLE_EXIT_AUTO_HELP", strtobool, True, "featflags"
|
|
)
|
|
|
|
# Remember contexts during session
|
|
REMEMBER_CONTEXTS = load_env_vars(
|
|
"OPENBB_REMEMBER_CONTEXTS", strtobool, True, "featflags"
|
|
)
|
|
|
|
# Use the colorful rich terminal
|
|
ENABLE_RICH = load_env_vars("OPENBB_ENABLE_RICH", strtobool, True, "featflags")
|
|
|
|
# Use the colorful rich terminal
|
|
ENABLE_RICH_PANEL = load_env_vars(
|
|
"OPENBB_ENABLE_RICH_PANEL", strtobool, True, "featflags"
|
|
)
|
|
|
|
# Check API KEYS before running a command
|
|
ENABLE_CHECK_API = load_env_vars(
|
|
"OPENBB_ENABLE_CHECK_API", strtobool, True, "featflags"
|
|
)
|
|
|
|
# Send logs to data lake
|
|
LOG_COLLECTION = load_env_vars("OPENBB_LOG_COLLECT", strtobool, True, "featflags")
|
|
|
|
# Provide export folder path. If empty that means default.
|
|
EXPORT_FOLDER_PATH = str(os.getenv("OPENBB_EXPORT_FOLDER_PATH", ""))
|
|
|
|
# Toolbar hint
|
|
TOOLBAR_HINT = load_env_vars("OPENBB_TOOLBAR_HINT", strtobool, True, "featflags")
|
|
|
|
# Select language to be used
|
|
USE_LANGUAGE = str(os.getenv("OPENBB_USE_LANGUAGE", "en"))
|
|
|
|
# File that contains a JSON dictionary of preferred sources for commands
|
|
PREFERRED_DATA_SOURCE_FILE = str(
|
|
os.getenv(
|
|
"OPENBB_PREFERRED_DATA_SOURCE_FILE",
|
|
USER_DATA_SOURCES_DEFAULT_FILE,
|
|
)
|
|
)
|
|
|
|
# Guess file
|
|
GUESS_EASTER_EGG_FILE = str(
|
|
os.getenv(
|
|
"OPENBB_GUESS_EASTER_EGG_FILE",
|
|
os.getcwd() + os.path.sep + "guess_game.json",
|
|
)
|
|
)
|
|
|
|
try:
|
|
if not WITH_GIT:
|
|
import pkg_resources
|
|
|
|
version = pkg_resources.get_distribution("OpenBB").version
|
|
else:
|
|
raise Exception("Using git")
|
|
except Exception:
|
|
version = "2.3.1"
|
|
VERSION = str(os.getenv("OPENBB_VERSION", version))
|
|
|
|
# Select the terminal translation language
|
|
i18n_dict_location = MISCELLANEOUS_DIRECTORY / "i18n"
|
|
i18n.load_path.append(i18n_dict_location)
|
|
i18n.set("locale", USE_LANGUAGE)
|
|
i18n.set("filename_format", "{locale}.{format}")
|