diff --git a/README.md b/README.md index 8c9170ac86c..d4618e4c529 100644 --- a/README.md +++ b/README.md @@ -1,57 +1,44 @@ - - - -[![Stargazers][stars-shield]][stars-url] -[![Forks][forks-shield]][forks-url] -[![Contributors][contributors-shield]][contributors-url] -[![MIT License][license-shield]][license-url] - -[![Issues][issues-shield]][issues-url] -[![Bugs Open][bugs-open-shield]][bugs-open-url] -[![Bugs Closed][bugs-closed-shield]][bugs-closed-url] - -[![GitHub release](https://img.shields.io/github/release/OpenBB-finance/OpenBBTerminal.svg?maxAge=3600)](https://github.com/OpenBB-finance/OpenBBTerminal/releases) -[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) -[![TODOs](https://badgen.net/https/api.tickgit.com/badgen/github.com/OpenBB-finance/OpenBBTerminal/main)](https://www.tickgit.com/browse?repo=github.com/OpenBB-finance/OpenBBTerminal&branch=main) - -![Discord Shield](https://discordapp.com/api/guilds/831165782750789672/widget.png?style=shield) -[![Twitter](https://img.shields.io/twitter/url/https/twitter.com/openbb_finance.svg?style=social&label=Follow%20%40openbb_finance)](https://twitter.com/openbb_finance) - -[![Open in Dev Containers](https://img.shields.io/static/v1?label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/OpenBB-finance/OpenBBTerminal) - -[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/OpenBB-finance/OpenBBTerminal) - - - -| OpenBB is committed to build the future of investment research by focusing on an open source infrastructure accessible to everyone, everywhere. | -|:--:| -| [![openbb.jpg](/images/openbb_gradient.png)](https://openbb.co) | -| Check our website at [openbb.co](https://openbb.co) | - +
+OpenBB Terminal logo +OpenBB Terminal logo +

+[![Twitter](https://img.shields.io/twitter/url/https/twitter.com/openbb_finance.svg?style=social&label=Follow%20%40openbb_finance)](https://twitter.com/openbb_finance) +[![GitHub release](https://img.shields.io/github/release/OpenBB-finance/OpenBBTerminal.svg?maxAge=3600)](https://github.com/OpenBB-finance/OpenBBTerminal/releases) +![Discord Shield](https://discordapp.com/api/guilds/831165782750789672/widget.png?style=shield) +[![Open in Dev Containers](https://img.shields.io/static/v1?label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/OpenBB-finance/OpenBBTerminal) + + + + +OpenBB is committed to building the future of investment research by focusing on an open-source infrastructure accessible to everyone, everywhere. +

-

OpenBB Terminal 🚀

-

Documentation can be found at: https://openbb.co/docs

-

Click on the GIF below for a DEMO of the terminal.

OpenBB Terminal Illustration +

Click on the GIF above for a DEMO

- ≪ GETTING STARTED -   ·   CONTRIBUTING   ·   + + ≪ GETTING STARTED + +   ·   + + CONTRIBUTING + +   ·   + + DOCUMENTATION + +   ·   - SEE FEATURES » + SEE FEATURES » +

diff --git a/images/openbb-logo-dark.svg b/images/openbb-logo-dark.svg new file mode 100644 index 00000000000..75bcef259e1 --- /dev/null +++ b/images/openbb-logo-dark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/images/openbb-logo-light.svg b/images/openbb-logo-light.svg new file mode 100644 index 00000000000..f9c341f7428 --- /dev/null +++ b/images/openbb-logo-light.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/openbb_terminal/core/models/credentials_model.py b/openbb_terminal/core/models/credentials_model.py index db6db656cee..a72d1a2ba6c 100644 --- a/openbb_terminal/core/models/credentials_model.py +++ b/openbb_terminal/core/models/credentials_model.py @@ -1,5 +1,6 @@ import json from dataclasses import make_dataclass +from typing import Any, List, Tuple from pydantic.dataclasses import dataclass as pydanticdataclass @@ -13,11 +14,13 @@ with open(MISCELLANEOUS_DIRECTORY / "models" / "local_credentials.json") as f: LOCAL_CREDENTIALS = json.load(f) +fields: List[Tuple[str, type, Any]] = [ + (k, str, "REPLACE_ME") for k in list(HUB_CREDENTIALS) + list(LOCAL_CREDENTIALS) +] + dc = make_dataclass( cls_name="CredentialsModel", - fields=[ - (k, str, "REPLACE_ME") for k in list(HUB_CREDENTIALS) + list(LOCAL_CREDENTIALS) - ], + fields=fields, bases=(BaseModel,), ) dc.__repr__ = dc.__base__.__repr__ # type: ignore diff --git a/openbb_terminal/core/session/local_model.py b/openbb_terminal/core/session/local_model.py index 64d9e868b36..8836950649f 100644 --- a/openbb_terminal/core/session/local_model.py +++ b/openbb_terminal/core/session/local_model.py @@ -128,6 +128,7 @@ def set_credentials_from_hub(configs: dict): """ if configs: credentials = configs.get("features_keys", {}) or {} + credentials = {k: v for k, v in credentials.items() if v} for k, v in credentials.items(): set_credential(k, v) diff --git a/openbb_terminal/cryptocurrency/onchain/bitquery_model.py b/openbb_terminal/cryptocurrency/onchain/bitquery_model.py index 00e9be9d9af..d35bc6ea79e 100644 --- a/openbb_terminal/cryptocurrency/onchain/bitquery_model.py +++ b/openbb_terminal/cryptocurrency/onchain/bitquery_model.py @@ -816,4 +816,7 @@ def get_spread_for_crypto_pair( return df -POSSIBLE_CRYPTOS = list(get_erc20_tokens()["symbol"].unique()) +@log_start_end(log=logger) +def get_possible_crypto_symbols(): + """Get possible crypto symbols.""" + return list(get_erc20_tokens()["symbol"].unique()) diff --git a/openbb_terminal/cryptocurrency/onchain/onchain_controller.py b/openbb_terminal/cryptocurrency/onchain/onchain_controller.py index 94eb9d6b330..44fa0e9f7dd 100644 --- a/openbb_terminal/cryptocurrency/onchain/onchain_controller.py +++ b/openbb_terminal/cryptocurrency/onchain/onchain_controller.py @@ -1395,7 +1395,7 @@ class OnchainController(BaseController): dest="coin", type=str, help="ERC20 token symbol or address.", - choices=bitquery_model.POSSIBLE_CRYPTOS, + choices=bitquery_model.get_possible_crypto_symbols(), metavar="COIN", ) parser.add_argument( @@ -1444,7 +1444,8 @@ class OnchainController(BaseController): ) if ns_parser: if ns_parser.coin: - if ns_parser.coin in bitquery_model.POSSIBLE_CRYPTOS: + possible_cryptos = bitquery_model.get_possible_crypto_symbols() + if ns_parser.coin in possible_cryptos: bitquery_view.display_spread_for_crypto_pair( symbol=ns_parser.coin, to_symbol=ns_parser.vs, @@ -1464,7 +1465,7 @@ class OnchainController(BaseController): else: similar_cmd = difflib.get_close_matches( ns_parser.coin, - bitquery_model.POSSIBLE_CRYPTOS, + possible_cryptos, n=1, cutoff=0.75, ) @@ -1486,7 +1487,7 @@ class OnchainController(BaseController): except Exception: similar_cmd = difflib.get_close_matches( ns_parser.coin, - bitquery_model.POSSIBLE_CRYPTOS, + possible_cryptos, n=1, cutoff=0.5, ) diff --git a/openbb_terminal/loggers.py b/openbb_terminal/loggers.py index bf93afb1f90..d21bd7e079a 100644 --- a/openbb_terminal/loggers.py +++ b/openbb_terminal/loggers.py @@ -283,6 +283,12 @@ def setup_handlers(settings: Settings): handler_list = logging_settings.handler_list verbosity = logging_settings.verbosity + # Remove any existing log handlers + # Notebooks have a root logging handler by default, see https://github.com/ipython/ipython/issues/8282 + root_logger = logging.getLogger() + if root_logger.hasHandlers(): + root_logger.handlers.clear() + logging.basicConfig( level=verbosity, format=FormatterWithExceptions.LOGFORMAT,