Merge branch 'feature/openbb-sdk-v4' of github.com:OpenBB-finance/OpenBBTerminal into feature/openbb-sdk-v4

This commit is contained in:
hjoaquim
2023-08-17 11:36:05 +01:00
5 changed files with 50 additions and 19 deletions

47
openbb_sdk/poetry.lock generated vendored
View File

@@ -1014,6 +1014,40 @@ files = [
{file = "numpy-1.24.4.tar.gz", hash = "sha256:80f5e3a4e498641401868df4208b74581206afbee7cf7b8329daae82676d9463"},
]
[[package]]
name = "numpy"
version = "1.25.2"
description = "Fundamental package for array computing in Python"
optional = false
python-versions = ">=3.9"
files = [
{file = "numpy-1.25.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:db3ccc4e37a6873045580d413fe79b68e47a681af8db2e046f1dacfa11f86eb3"},
{file = "numpy-1.25.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:90319e4f002795ccfc9050110bbbaa16c944b1c37c0baeea43c5fb881693ae1f"},
{file = "numpy-1.25.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dfe4a913e29b418d096e696ddd422d8a5d13ffba4ea91f9f60440a3b759b0187"},
{file = "numpy-1.25.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f08f2e037bba04e707eebf4bc934f1972a315c883a9e0ebfa8a7756eabf9e357"},
{file = "numpy-1.25.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:bec1e7213c7cb00d67093247f8c4db156fd03075f49876957dca4711306d39c9"},
{file = "numpy-1.25.2-cp310-cp310-win32.whl", hash = "sha256:7dc869c0c75988e1c693d0e2d5b26034644399dd929bc049db55395b1379e044"},
{file = "numpy-1.25.2-cp310-cp310-win_amd64.whl", hash = "sha256:834b386f2b8210dca38c71a6e0f4fd6922f7d3fcff935dbe3a570945acb1b545"},
{file = "numpy-1.25.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c5462d19336db4560041517dbb7759c21d181a67cb01b36ca109b2ae37d32418"},
{file = "numpy-1.25.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c5652ea24d33585ea39eb6a6a15dac87a1206a692719ff45d53c5282e66d4a8f"},
{file = "numpy-1.25.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0d60fbae8e0019865fc4784745814cff1c421df5afee233db6d88ab4f14655a2"},
{file = "numpy-1.25.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:60e7f0f7f6d0eee8364b9a6304c2845b9c491ac706048c7e8cf47b83123b8dbf"},
{file = "numpy-1.25.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:bb33d5a1cf360304754913a350edda36d5b8c5331a8237268c48f91253c3a364"},
{file = "numpy-1.25.2-cp311-cp311-win32.whl", hash = "sha256:5883c06bb92f2e6c8181df7b39971a5fb436288db58b5a1c3967702d4278691d"},
{file = "numpy-1.25.2-cp311-cp311-win_amd64.whl", hash = "sha256:5c97325a0ba6f9d041feb9390924614b60b99209a71a69c876f71052521d42a4"},
{file = "numpy-1.25.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b79e513d7aac42ae918db3ad1341a015488530d0bb2a6abcbdd10a3a829ccfd3"},
{file = "numpy-1.25.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:eb942bfb6f84df5ce05dbf4b46673ffed0d3da59f13635ea9b926af3deb76926"},
{file = "numpy-1.25.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3e0746410e73384e70d286f93abf2520035250aad8c5714240b0492a7302fdca"},
{file = "numpy-1.25.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d7806500e4f5bdd04095e849265e55de20d8cc4b661b038957354327f6d9b295"},
{file = "numpy-1.25.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8b77775f4b7df768967a7c8b3567e309f617dd5e99aeb886fa14dc1a0791141f"},
{file = "numpy-1.25.2-cp39-cp39-win32.whl", hash = "sha256:2792d23d62ec51e50ce4d4b7d73de8f67a2fd3ea710dcbc8563a51a03fb07b01"},
{file = "numpy-1.25.2-cp39-cp39-win_amd64.whl", hash = "sha256:76b4115d42a7dfc5d485d358728cdd8719be33cc5ec6ec08632a5d6fca2ed380"},
{file = "numpy-1.25.2-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:1a1329e26f46230bf77b02cc19e900db9b52f398d6722ca853349a782d4cff55"},
{file = "numpy-1.25.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4c3abc71e8b6edba80a01a52e66d83c5d14433cbcd26a40c329ec7ed09f37901"},
{file = "numpy-1.25.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:1b9735c27cea5d995496f46a8b1cd7b408b3f34b6d50459d9ac8fe3a20cc17bf"},
{file = "numpy-1.25.2.tar.gz", hash = "sha256:fd608e19c8d7c55021dffd43bfe5492fab8cc105cc8986f813f8c3c048b38760"},
]
[[package]]
name = "openbb-benzinga"
version = "0.1.1"
@@ -1257,6 +1291,7 @@ files = []
develop = false
[package.dependencies]
importlib_metadata = "^6.8.0"
pydantic = {version = "^1.10", extras = ["dotenv"]}
requests = "^2.31.0"
urllib3 = "<2.0.0"
@@ -1525,13 +1560,13 @@ test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4)", "pytest-co
[[package]]
name = "plotly"
version = "5.16.0"
version = "5.16.1"
description = "An open-source, interactive data visualization library for Python"
optional = false
python-versions = ">=3.6"
files = [
{file = "plotly-5.16.0-py2.py3-none-any.whl", hash = "sha256:046ba0cd9f6b251780e0d93313016ec5e2cb69d9a68da818cd7110e6c77a4011"},
{file = "plotly-5.16.0.tar.gz", hash = "sha256:13dc052665dcb4d9eefd89847c0b144984e99aca5c8008f9885d2583b77d8b7d"},
{file = "plotly-5.16.1-py2.py3-none-any.whl", hash = "sha256:19cc34f339acd4e624177806c14df22f388f23fb70658b03aad959a0e650a0dc"},
{file = "plotly-5.16.1.tar.gz", hash = "sha256:295ac25edeb18c893abb71dcadcea075b78fd6fdf07cee4217a4e1009667925b"},
]
[package.dependencies]
@@ -2606,13 +2641,13 @@ multidict = ">=4.0"
[[package]]
name = "yfinance"
version = "0.2.27"
version = "0.2.28"
description = "Download market data from Yahoo! Finance API"
optional = false
python-versions = "*"
files = [
{file = "yfinance-0.2.27-py2.py3-none-any.whl", hash = "sha256:e1835a7b744f16b0d419c43e7135a105e09ed95276f99cea0017faf3607dfe79"},
{file = "yfinance-0.2.27.tar.gz", hash = "sha256:d5c057963f4f1842d65d28fb5444d0b45b8082988baa64e703b87c6454d88642"},
{file = "yfinance-0.2.28-py2.py3-none-any.whl", hash = "sha256:9697dcbc38d67d1172a905fd5787c65bf049d87e18a709be788485ad7886791c"},
{file = "yfinance-0.2.28.tar.gz", hash = "sha256:be89cd2a4d55c0a2a6227c32915b355bde59f85c569dca9123320322445901ff"},
]
[package.dependencies]

View File

@@ -1,7 +1,7 @@
from importlib import import_module
from typing import Callable, Generic, Optional, Tuple, TypeVar
import importlib_metadata
from importlib_metadata import entry_points
from openbb_core.app.model.abstract.singleton import SingletonMeta
from openbb_core.app.model.charts.chart import Chart, ChartFormat
@@ -87,8 +87,7 @@ class ChartingManager(metaclass=SingletonMeta):
bool
Either charting extension is installed or not.
"""
entry_points = importlib_metadata.entry_points(group=plugin)
extensions = [ext.name for ext in entry_points]
extensions = [ext.name for ext in entry_points(group=plugin)]
return charting_extension in extensions
@@ -99,7 +98,7 @@ class ChartingManager(metaclass=SingletonMeta):
"""
Get the module of the given extension.
"""
for entry_point in importlib_metadata.entry_points(group=plugin):
for entry_point in entry_points(group=plugin):
if entry_point.name == extension_name:
return import_module(entry_point.module)

View File

@@ -16,8 +16,8 @@ from typing import (
overload,
)
import importlib_metadata
from fastapi import APIRouter, Depends
from importlib_metadata import entry_points
from pydantic import BaseModel
from pydantic.config import BaseConfig
from pydantic.validators import find_validators
@@ -441,9 +441,7 @@ class RouterLoader:
def from_extensions() -> Router:
router = Router()
for entry_point in importlib_metadata.entry_points(
group="openbb_core_extension"
):
for entry_point in entry_points(group="openbb_core_extension"):
try:
router.include_router(
router=entry_point.load(), prefix=f"/{entry_point.name}"

View File

@@ -2,7 +2,7 @@
from typing import Dict
import importlib_metadata
from importlib_metadata import entry_points
from openbb_provider.abstract.provider import Provider
@@ -37,12 +37,10 @@ class RegistryLoader:
def from_extensions() -> Registry:
"""Load providers from entry points."""
registry = Registry()
for entry_point in importlib_metadata.entry_points(
group="openbb_provider_extension"
):
for entry_point in sorted(entry_points(group="openbb_provider_extension")):
try:
registry.include_provider(
provider=entry_point.load(),
provider=entry_point.load()
)
except Exception as e:
raise LoadingError(f"Invalid provider '{entry_point.name}': {e}") from e

View File

@@ -8,6 +8,7 @@ packages = [{ include = "openbb_provider" }]
[tool.poetry.dependencies]
python = "^3.8"
importlib_metadata = "^6.8.0"
pydantic = { extras = ["dotenv"], version = "^1.10" }
requests = "^2.31.0"
urllib3 = "<2.0.0"