summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormontezdesousa <79287829+montezdesousa@users.noreply.github.com>2024-04-29 09:40:23 +0100
committerGitHub <noreply@github.com>2024-04-29 09:40:23 +0100
commit22805280ea17de7fc7f287f9dc5a095ffda87a10 (patch)
tree0bab8df6ae355f5cea51af5c808b4d42cbd33a40
parentf029a07a79d6c5218fa0bb200e1c792d72054b85 (diff)
Feature/move terminal files (#6344)feature/argparse_translator
* Move terminal files into openbb_terminal * move routines * Create session to handle console, user, settings, etc. * Reset... * Bring back frontend-components * Move frontend-components to openbb_terminal * rename vars * remove doc * rename method * rename method * fix routines * read settings from .env * rename methods * ^ * ^ * better * bug * ^ * move frontend-components back to root level * revert changes * type checking only * docstring * fix: settings autocomplete * comment * use openbb_core singleton * rename src to fix openbb command * fix poetry build * readme --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt>
-rw-r--r--.dockerignore11
-rw-r--r--.github/workflows/linting.yml2
-rw-r--r--.readthedocs.yaml20
-rw-r--r--MANIFEST.in1
-rw-r--r--json_validate_exclude.txt3
-rw-r--r--openbb_platform/providers/yfinance/openbb_yfinance/__init__.py3
-rw-r--r--openbb_terminal/CONTRIBUTING.md (renamed from CONTRIBUTING.md)6
-rw-r--r--openbb_terminal/README.md3
-rw-r--r--openbb_terminal/__init__.py1
-rw-r--r--openbb_terminal/cli.py20
-rw-r--r--openbb_terminal/core/__init__.py1
-rw-r--r--openbb_terminal/core/config/paths.py23
-rw-r--r--openbb_terminal/core/controllers/intro.json155
-rw-r--r--openbb_terminal/core/controllers/menu.py30
-rw-r--r--openbb_terminal/core/controllers/terminal_helper.py252
-rw-r--r--openbb_terminal/core/models/__init__.py6
-rw-r--r--openbb_terminal/core/models/base_model.py44
-rw-r--r--openbb_terminal/core/models/settings.py46
-rw-r--r--openbb_terminal/core/session/__init__.py1
-rw-r--r--openbb_terminal/core/session/banner.txt18
-rw-r--r--openbb_terminal/core/session/constants.py60
-rw-r--r--openbb_terminal/core/session/current_settings.py40
-rw-r--r--openbb_terminal/core/session/current_user.py26
-rw-r--r--openbb_terminal/core/session/env_handler.py82
-rw-r--r--openbb_terminal/core/session/hub_service.py203
-rw-r--r--openbb_terminal/core/session/launcher.py17
-rw-r--r--openbb_terminal/core/session/routines/__init__.py1
-rw-r--r--openbb_terminal/core/session/routines/account_view.py86
-rw-r--r--openbb_terminal/core/session/routines/routines_handler.py180
-rw-r--r--openbb_terminal/core/session/utils.py82
-rw-r--r--openbb_terminal/miscellaneous/i18n/help_translation.ipynb195
-rw-r--r--openbb_terminal/openbb_terminal/__init__.py1
-rw-r--r--openbb_terminal/openbb_terminal/argparse_translator/__init__.py (renamed from argparse_translator/__init__.py)0
-rw-r--r--openbb_terminal/openbb_terminal/argparse_translator/argparse_class_processor.py (renamed from argparse_translator/argparse_class_processor.py)2
-rw-r--r--openbb_terminal/openbb_terminal/argparse_translator/argparse_translator.py (renamed from argparse_translator/argparse_translator.py)0
-rw-r--r--openbb_terminal/openbb_terminal/argparse_translator/obbject_registry.py (renamed from argparse_translator/obbject_registry.py)0
-rw-r--r--openbb_terminal/openbb_terminal/assets/i18n/en.yml (renamed from openbb_terminal/miscellaneous/i18n/en.yml)3
-rw-r--r--openbb_terminal/openbb_terminal/assets/routines/routine_example.openbb (renamed from openbb_terminal/miscellaneous/routines/routine_example.openbb)0
-rw-r--r--openbb_terminal/openbb_terminal/assets/styles/default/Consolas.ttf (renamed from openbb_terminal/miscellaneous/styles/default/Consolas.ttf)bin358460 -> 358460 bytes
-rw-r--r--openbb_terminal/openbb_terminal/assets/styles/default/dark.mpfstyle.json (renamed from openbb_terminal/miscellaneous/styles/default/dark.mpfstyle.json)0
-rw-r--r--openbb_terminal/openbb_terminal/assets/styles/default/dark.mplrc.json (renamed from openbb_terminal/miscellaneous/styles/default/dark.mplrc.json)0
-rw-r--r--openbb_terminal/openbb_terminal/assets/styles/default/dark.mplstyle (renamed from openbb_terminal/miscellaneous/styles/default/dark.mplstyle)0
-rw-r--r--openbb_terminal/openbb_terminal/assets/styles/default/dark.pltstyle.json (renamed from openbb_terminal/miscellaneous/styles/default/dark.pltstyle.json)0
-rw-r--r--openbb_terminal/openbb_terminal/assets/styles/default/dark.richstyle.json (renamed from openbb_terminal/miscellaneous/styles/default/dark.richstyle.json)0
-rw-r--r--openbb_terminal/openbb_terminal/assets/styles/default/light.mpfstyle.json (renamed from openbb_terminal/miscellaneous/styles/default/light.mpfstyle.json)0
-rw-r--r--openbb_terminal/openbb_terminal/assets/styles/default/light.mplrc.json (renamed from openbb_terminal/miscellaneous/styles/default/light.mplrc.json)0
-rw-r--r--openbb_terminal/openbb_terminal/assets/styles/default/light.mplstyle (renamed from openbb_terminal/miscellaneous/styles/default/light.mplstyle)0
-rw-r--r--openbb_terminal/openbb_terminal/assets/styles/default/light.pltstyle.json (renamed from openbb_terminal/miscellaneous/styles/default/light.pltstyle.json)0
-rw-r--r--openbb_terminal/openbb_terminal/assets/styles/default/light.richstyle.json (renamed from openbb_terminal/miscellaneous/styles/default/light.richstyle.json)0
-rw-r--r--openbb_terminal/openbb_terminal/assets/styles/default/tables.pltstyle.json (renamed from openbb_terminal/miscellaneous/styles/default/tables.pltstyle.json)0
-rw-r--r--openbb_terminal/openbb_terminal/assets/styles/user/openbb.richstyle.json (renamed from openbb_terminal/miscellaneous/styles/user/openbb.richstyle.json)0
-rw-r--r--openbb_terminal/openbb_terminal/cli.py20
-rw-r--r--openbb_terminal/openbb_terminal/config/__init__.py (renamed from openbb_terminal/core/config/__init__.py)0
-rw-r--r--openbb_terminal/openbb_terminal/config/completer.py (renamed from openbb_terminal/core/config/completer.py)2
-rw-r--r--openbb_terminal/openbb_terminal/config/console.py97
-rw-r--r--openbb_terminal/openbb_terminal/config/constants.py83
-rw-r--r--openbb_terminal/openbb_terminal/config/menu_text.py (renamed from openbb_terminal/core/config/rich_config.py)133
-rw-r--r--openbb_terminal/openbb_terminal/config/setup.py (renamed from openbb_terminal/core/config/config_terminal.py)17
-rw-r--r--openbb_terminal/openbb_terminal/config/style.py (renamed from openbb_terminal/core/config/terminal_style.py)88
-rw-r--r--openbb_terminal/openbb_terminal/controllers/base_controller.py (renamed from openbb_terminal/core/controllers/base_controller.py)184
-rw-r--r--openbb_terminal/openbb_terminal/controllers/base_platform_controller.py (renamed from openbb_terminal/core/controllers/base_platform_controller.py)35
-rw-r--r--openbb_terminal/openbb_terminal/controllers/choices.py (renamed from openbb_terminal/core/controllers/choices.py)12
-rw-r--r--openbb_terminal/openbb_terminal/controllers/feature_flags_controller.py (renamed from openbb_terminal/core/controllers/featflags_controller.py)134
-rw-r--r--openbb_terminal/openbb_terminal/controllers/hub_service.py105
-rw-r--r--openbb_terminal/openbb_terminal/controllers/platform_controller_factory.py (renamed from openbb_terminal/core/controllers/platform_controller_factory.py)6
-rw-r--r--openbb_terminal/openbb_terminal/controllers/script_parser.py (renamed from openbb_terminal/core/session/routines/routine_functions.py)6
-rw-r--r--openbb_terminal/openbb_terminal/controllers/terminal_controller.py (renamed from openbb_terminal/core/controllers/terminal_controller.py)135
-rw-r--r--openbb_terminal/openbb_terminal/controllers/utils.py (renamed from openbb_terminal/core/controllers/helper_funcs.py)363
-rw-r--r--openbb_terminal/openbb_terminal/models/settings.py86
-rw-r--r--openbb_terminal/openbb_terminal/session.py79
-rw-r--r--openbb_terminal/poetry.lock (renamed from poetry.lock)314
-rw-r--r--openbb_terminal/pyproject.toml (renamed from pyproject.toml)2
-rw-r--r--openbb_terminal/tests/__init__.py (renamed from tests/__init__.py)0
-rw-r--r--requirements-full.txt429
-rw-r--r--requirements.txt282
-rw-r--r--tests/README.md690
-rw-r--r--tests/conftest.py504
-rw-r--r--tests/helpers/__init__.py0
-rw-r--r--tests/helpers/helpers.py41
-rw-r--r--tests/helpers/tools.py65
-rw-r--r--tests/test_helpers.py9
-rw-r--r--tests/website/__init__.py0
-rw-r--r--tests/website/conftest.py7
-rw-r--r--tests/website/test_generate_docs.py109
84 files changed, 1199 insertions, 4462 deletions
diff --git a/.dockerignore b/.dockerignore
deleted file mode 100644
index 6f700b65fbf..00000000000
--- a/.dockerignore
+++ /dev/null
@@ -1,11 +0,0 @@
-.git
-.*
-.dockerignore
-.gitignore
-docker-compose.yaml
-Dockerfile*
-.vscode
-.idea
-__pycache__
-.python-version
-logs/
diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml
index 2f068019a35..2abf2e5455f 100644
--- a/.github/workflows/linting.yml
+++ b/.github/workflows/linting.yml
@@ -95,5 +95,3 @@ jobs:
- name: json-yaml-validate
id: json-yaml-validate
uses: GrantBirki/json-yaml-validate@v2.0.0
- with:
- exclude_file: json_validate_exclude.txt
diff --git a/.readthedocs.yaml b/.readthedocs.yaml
deleted file mode 100644
index 3dacb80bae9..00000000000
--- a/.readthedocs.yaml
+++ /dev/null
@@ -1,20 +0,0 @@
-# .readthedocs.yaml
-# Read the Docs configuration file
-# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
----
-# Required
-version: 2
-
-# Build documentation in the docs/ directory with Sphinx
-sphinx:
- configuration: docs/conf.py
-
-# Optionally build your docs in additional formats such as PDF
-# formats:
-# - pdf
-
-# Optionally set the version of Python and requirements to build your docs
-python:
- version: 3.7
- install:
- - requirements: requirements-full.txt
diff --git a/MANIFEST.in b/MANIFEST.in
deleted file mode 100644
index a9fc50aa947..00000000000
--- a/MANIFEST.in
+++ /dev/null
@@ -1 +0,0 @@
-include openbb_terminal/.env \ No newline at end of file
diff --git a/json_validate_exclude.txt b/json_validate_exclude.txt
deleted file mode 100644
index da93f0e08ad..00000000000
--- a/json_validate_exclude.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-tests/
-openbb_terminal/miscellaneous/gpt_index/index_0.4.json
-.devcontainer/devcontainer.json \ No newline at end of file
diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/__init__.py b/openbb_platform/providers/yfinance/openbb_yfinance/__init__.py
index ad777281871..2e1fc8ce7e8 100644
--- a/openbb_platform/providers/yfinance/openbb_yfinance/__init__.py
+++ b/openbb_platform/providers/yfinance/openbb_yfinance/__init__.py
@@ -27,9 +27,6 @@ from openbb_yfinance.models.index_historical import (
from openbb_yfinance.models.key_executives import YFinanceKeyExecutivesFetcher
from openbb_yfinance.models.key_metrics import YFinanceKeyMetricsFetcher
from openbb_yfinance.models.losers import YFLosersFetcher
-from openbb_yfinance.models.market_indices import (
- YFinanceMarketIndicesFetcher,
-)
from openbb_yfinance.models.price_target_consensus import (
YFinancePriceTargetConsensusFetcher,
)
diff --git a/CONTRIBUTING.md b/openbb_terminal/CONTRIBUTING.md
index d76ef13106a..49314e4a8e4 100644
--- a/CONTRIBUTING.md
+++ b/openbb_terminal/CONTRIBUTING.md
@@ -109,7 +109,7 @@ import logging
import pandas as pd
-from openbb_terminal.core.session.current_user import get_current_user
+from src.current_user import get_current_user
from openbb_terminal.decorators import check_api_key, log_start_end
from openbb_terminal.helpers import request
@@ -1643,7 +1643,7 @@ Here is an example of **accessing** a setting:
```python
-from openbb_terminal.core.session.current_system import get_current_system
+from src.current_system import get_current_system
system = get_current_system()
system = get_current_system()
@@ -1657,7 +1657,7 @@ And here is an example of **changing** a setting:
```python
-from openbb_terminal.core.session.current_system import get_current_system
+from src.current_system import get_current_system
set_system_variable("TEST_MODE", True)
diff --git a/openbb_terminal/README.md b/openbb_terminal/README.md
new file mode 100644
index 00000000000..28bcbff336d
--- /dev/null
+++ b/openbb_terminal/README.md
@@ -0,0 +1,3 @@
+# OpenBB CLI
+
+Work in progress.
diff --git a/openbb_terminal/__init__.py b/openbb_terminal/__init__.py
deleted file mode 100644
index 782b10b6d96..00000000000
--- a/openbb_terminal/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-"""OpenBB Platform CLI initialization."""
diff --git a/openbb_terminal/cli.py b/openbb_terminal/cli.py
deleted file mode 100644
index 866df07cab1..00000000000
--- a/openbb_terminal/cli.py
+++ /dev/null
@@ -1,20 +0,0 @@
-"""OpenBB Terminal CLI entry point."""
-
-import sys
-
-import openbb_terminal.core.config.config_terminal as cfg
-from openbb_terminal.core.session import launcher
-
-
-def main():
- """Use the main entry point for the OpenBB Terminal CLI."""
- cfg.setup_config_terminal()
-
- dev = "--dev" in sys.argv[1:]
- debug = "--debug" in sys.argv[1:]
-
- launcher.launch_terminal(dev=dev, debug=debug)
-
-
-if __name__ == "__main__":
- main()
diff --git a/openbb_terminal/core/__init__.py b/openbb_terminal/core/__init__.py
deleted file mode 100644
index 324a0b1455e..00000000000
--- a/openbb_terminal/core/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-"""Core init."""
diff --git a/openbb_terminal/core/config/paths.py b/openbb_terminal/core/config/paths.py
deleted file mode 100644
index 8a4c6553599..00000000000
--- a/openbb_terminal/core/config/paths.py
+++ /dev/null
@@ -1,23 +0,0 @@
-"""Paths for the package."""
-
-from pathlib import Path
-
-# Installation related paths
-HOME_DIRECTORY = Path.home()
-REPOSITORY_DIRECTORY = Path(__file__).parent.parent.parent.parent
-PACKAGE_DIRECTORY = Path(__file__).parent.parent.parent
-MISCELLANEOUS_DIRECTORY = PACKAGE_DIRECTORY / "miscellaneous"
-
-SETTINGS_DIRECTORY = HOME_DIRECTORY / ".openbb_terminal"
-HIST_FILE_PATH = SETTINGS_DIRECTORY / ".openbb_terminal.his"
-
-# i18n_dict_location
-I18N_DICT_LOCATION = MISCELLANEOUS_DIRECTORY / "i18n"
-
-# styles
-STYLES_DIRECTORY_REPO = MISCELLANEOUS_DIRECTORY / "styles"
-
-# env
-REPOSITORY_ENV_FILE = REPOSITORY_DIRECTORY / ".env"
-PACKAGE_ENV_FILE = PACKAGE_DIRECTORY / ".env"
-SETTINGS_ENV_FILE = SETTINGS_DIRECTORY / ".env"
diff --git a/openbb_terminal/core/controllers/intro.json b/openbb_terminal/core/controllers/intro.json
deleted file mode 100644
index 8b3c70f323d..00000000000
--- a/openbb_terminal/core/controllers/intro.json
+++ /dev/null
@@ -1,155 +0,0 @@
-{
- "prompts": [
- {
- "header": "Welcome to the OpenBB Terminal.",
- "content": [
- "\nThe following walkthrough will guide you towards making the most out of the OpenBB Terminal.\n\n",
- "Press [param]Enter[/param] to continue or [param]'q'[/param] followed by [param]Enter[/param] to exit."
- ]
- },
- {
- "header": "#1 - Commands vs menu.",
- "content": [
- "\nMenus are a collection of 'commands' and 'sub-menus'.\n",
- "You can identify them through their distinct color and a '>' at the beginning of the line\n\n",
- "For instance:\n",
- "[menu]> stocks access historical pricing data, options, sector [/menu]",
- "[menu]and industry, and overall due diligence [/menu]\n\n",
- "Commands are expected to return data either as a chart or table.\n",
- "You can identify them through their distinct color\n\n",
- "For instance:\n",
- "[cmds] news display news articles based on term and data sources [/cmds]"
- ]
- },
- {
- "header": "#2 - Using commands",
- "content": [
- "\nCommands throughout the terminal can have additional arguments.\n\n",
- "Let's say that in the current menu, you want to have more information about the comma