Fix imports for installed python packages

This commit is contained in:
Theodore Aptekarev
2023-07-07 21:28:53 +02:00
parent a9de3ea554
commit 38c8edc76e
5 changed files with 16 additions and 17 deletions

View File

@@ -65,7 +65,7 @@ Close for closing price column name in data from one provider might be coded as
### 1. Defining : OpenBB QueryParams
```python
from openbb_providers.openbb_provider.model.data.stock_eod import StockEODQueryParams
from openbb_provider.model.data.stock_eod import StockEODQueryParams
query = StockEODQueryParams(
symbol="AAPL",
@@ -76,7 +76,7 @@ query = StockEODQueryParams(
### 2. Querying the Provider Table : OpenBB QueryParams -> OpenBB Data
```python
from openbb_providers.openbb_provider.provider.provider_registry import provider_registry
from openbb_provider.provider.provider_registry import provider_registry
data = provider_registry.fetch(provider_name="fmp", query=query)
print(data)

View File

@@ -1,9 +1,8 @@
"""OpenBB Provider command Coverage Router."""
from openbb_provider.provider.abstract.provider import ProviderName
from openbb_sdk_core.app.model.command_output import CommandOutput
from openbb_sdk_core.app.router import CommandMap, Router
from openbb_providers.openbb_provider.provider.abstract.provider import ProviderName
router = Router()

View File

@@ -1,4 +1,11 @@
# flake8: noqa
from openbb_sdk.openbb_sdk_core.openbb_sdk_core.app.static.command_runner_wrapper import (
app,
)
from openbb_sdk_core.app.static.command_runner_wrapper import app as openbb
def _rebuild_python_interface() -> None:
"""Rebuild the Python SDK."""
from openbb_sdk_core.app.static.package_builder import ( # pylint: disable=import-outside-toplevel
PackageBuilder,
)
PackageBuilder.build()

View File

@@ -2,17 +2,11 @@ import platform as pl # I do this so that the import doesn't conflict with the
from pathlib import Path
from typing import List, Literal, Optional
import tomli
from pydantic import Field, root_validator, validator
from openbb_sdk_core.app.model.abstract.tagged import Tagged
from openbb_sdk_core.logs.utils.system_utils import get_branch, get_commit_hash
with open(
Path(__file__).parent.parent.parent.parent / "pyproject.toml", mode="rb"
) as f:
pyproject = tomli.load(f)
class SystemSettings(Tagged):
run_in_isolation: bool = Field(
@@ -30,7 +24,8 @@ class SystemSettings(Tagged):
platform: str = str(pl.platform())
# OpenBB section
version: str = pyproject["tool"]["poetry"]["version"]
# TODO: Get the version of the SDK from somewhere that's not pyproject.toml
version: str = "4.0.0dev"
home_directory: str = str(Path.home())
openbb_directory: str = str(Path(home_directory, ".openbb"))

View File

@@ -4,11 +4,9 @@ import warnings
from dataclasses import asdict
from typing import Any, Dict, Optional
from openbb_provider.provider.provider_registry import build_provider_registry
from pydantic import BaseModel
from openbb_providers.openbb_provider.provider.provider_registry import (
build_provider_registry,
)
from openbb_sdk_core.app.model.abstract.warning import OpenBBWarning
from openbb_sdk_core.app.model.command_context import CommandContext
from openbb_sdk_core.app.provider_interface import (