Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small QA to rename SDK to Platform #5544

Merged
merged 5 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openbb_platform/extensions/crypto/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Crypto data extension for OpenBB SDK
# Crypto data extension for OpenBB Platform

This extension provides a set of commands for crypto data retrieval.

Expand Down
2 changes: 1 addition & 1 deletion openbb_platform/extensions/econometrics/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Econometrics extension for OpenBB SDK
# Econometrics extension for OpenBB Platform

This extension provides a set of econometrics tools.

Expand Down
2 changes: 1 addition & 1 deletion openbb_platform/extensions/economy/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenBB Economy Extension

The Economy extension provides global macroeconomic data access for the OpenBB SDK.
The Economy extension provides global macroeconomic data access for the OpenBB Platform.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion openbb_platform/extensions/fixedincome/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenBB Fixed Income Extension

This extension provides fixed income data for the OpenBB SDK.
This extension provides fixed income data for the OpenBB Platform.

Features of the Fixed Income extension include information on government bonds and central bank rates.

Expand Down
2 changes: 1 addition & 1 deletion openbb_platform/extensions/forex/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenBB Forex Extension

This extension provides currency exchange related data for the OpenBB SDK.
This extension provides currency exchange related data for the OpenBB Platform.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion openbb_platform/extensions/futures/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Futures data extension for OpenBB SDK
# Futures data extension for OpenBB Platform

This extension provides a set of commands for futures data retrieval.

Expand Down
2 changes: 1 addition & 1 deletion openbb_platform/extensions/news/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenBB News Extension

This extension provides news for the OpenBB SDK.
This extension provides news for the OpenBB Platform.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion openbb_platform/extensions/qa/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenBB QA Extension

This extension provides Quantitative Analysis (QA) tools for the OpenBB SDK.
This extension provides Quantitative Analysis (QA) tools for the OpenBB Platform.

Features of the QA extension include various statistical tools and models.

Expand Down
2 changes: 1 addition & 1 deletion openbb_platform/extensions/stocks/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenBB Stocks Extension

This extension provides stock market data tools for the OpenBB SDK.
This extension provides stock market data tools for the OpenBB Platform.

Features of the Stocks extension include:

Expand Down
2 changes: 1 addition & 1 deletion openbb_platform/extensions/ta/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenBB TA Extension

This extension provides Technical Analysis (TA) tools for the OpenBB SDK.
This extension provides Technical Analysis (TA) tools for the OpenBB Platform.

Features of the TA extension include various TA indicators and oscillators.

Expand Down
2 changes: 1 addition & 1 deletion openbb_platform/openbb/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""OpenBB SDK."""
"""OpenBB Platform."""
# flake8: noqa

import os
Expand Down
10 changes: 5 additions & 5 deletions openbb_platform/platform/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

## 1. Introduction

This directory contains the OpenBB SDK's core functionality. It allows you to create an [extension](../../extensions/README.md) or a [provider](../../providers/README.md) that will be automatically turned into REST API endpoint and allow sharing data between commands.
This directory contains the OpenBB Platform's core functionality. It allows you to create an [extension](../../extensions/README.md) or a [provider](../../providers/README.md) that will be automatically turned into REST API endpoint and allow sharing data between commands.


## 2. How to install?
Expand Down Expand Up @@ -297,7 +297,7 @@ from openbb import obb
# Login with personal access token
obb.account.login(pat="your_pat", remember_me=True) # pragma: allowlist secret

# Login with email, password or SDK token
# Login with email, password or Platform token
obb.account.login(email="your_email", password="your_password", remember_me=True) # pragma: allowlist secret

# Change a credential
Expand All @@ -317,7 +317,7 @@ obb.account.logout()

How do we execute commands?

OpenBB SDK core is a REST API powered by FastAPI. We use this feature to run commands both in a web server setting and also in the `openbb` python package.
OpenBB Platform core is a REST API powered by FastAPI. We use this feature to run commands both in a web server setting and also in the `openbb` python package.

If you are using the `openbb` package, running the command below triggers a "request" to the `CommandRunner` class. The "request" will be similar to the one found in [4.2 Dynamic version](#42-dynamic-version). This will hit the endpoint matching the command and return the result.

Expand All @@ -335,7 +335,7 @@ obb.stocks.load(

### 4.1.5. Environment variables

The OS environment is only read once before the program starts, so make sure you change the variable before importing the SDK. We use the prefix "OPENBB_" to avoid polluting the environment (no pun intended).
The OS environment is only read once before the program starts, so make sure you change the variable before importing the Platform. We use the prefix "OPENBB_" to avoid polluting the environment (no pun intended).

To apply an environment variable use one of the following:

Expand Down Expand Up @@ -400,7 +400,7 @@ extra: ... # Extra info.

## 5. REST API

OpenBB SDK comes with a ready to use Rest API built with FastAPI. Start the application using this command:
OpenBB Platform comes with a ready to use Rest API built with FastAPI. Start the application using this command:

```bash
uvicorn openbb_core.api.rest_api:app --reload
Expand Down
4 changes: 2 additions & 2 deletions openbb_platform/platform/core/openbb_core/api/rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
logger = logging.getLogger("uvicorn.error")

app = FastAPI(
title="OpenBB SDK API",
description="This is the OpenBB SDK API.",
title="OpenBB Platform API",
description="This is the OpenBB Platform API.",
version="0.0.1",
terms_of_service="http://example.com/terms/",
contact={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ class SystemSettings(Tagged):
platform: str = FrozenField(default=str(pl.platform()))

# OpenBB section
# TODO: Get the version of the SDK from somewhere that's not pyproject.toml
# TODO: Get the version of the Platform from somewhere that's not pyproject.toml
version: str = FrozenField(default=VERSION)
home_directory: str = FrozenField(default=str(HOME_DIRECTORY))
openbb_directory: str = FrozenField(default=str(OPENBB_DIRECTORY))
user_settings_path: str = FrozenField(default=str(USER_SETTINGS_PATH))
system_settings_path: str = FrozenField(default=str(SYSTEM_SETTINGS_PATH))

# Logging section
logging_app_name: Literal["sdk"] = FrozenField(default="sdk")
logging_app_name: Literal["platform"] = FrozenField(default="platform")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hjoaquim is this fine?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, no issues here. Posthog will just get the new value.

logging_commit_hash: Optional[str] = FrozenField(default=None)
logging_frequency: Literal["D", "H", "M", "S"] = FrozenField(default="H")
logging_handlers: List[str] = FrozenField(default_factory=lambda: ["file"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ def _get_session_from_email_password(self, email: str, password: str) -> HubSess
raise HTTPException(status_code, detail)

def _get_session_from_sdk_token(self, token: str) -> HubSession:
"""Get session from SDK personal access token."""
"""Get session from Platform personal access token."""
if not token:
raise OpenBBError("SDK personal access token not found.")
raise OpenBBError("Platform personal access token not found.")

self.check_token_expiration(token)

Expand Down Expand Up @@ -216,7 +216,7 @@ def _put_user_settings(

@classmethod
def hub2sdk(cls, settings: HubUserSettings) -> Credentials:
"""Convert Hub user settings to SDK models."""
"""Convert Hub user settings to Platform models."""
credentials = Credentials(
alpha_vantage_api_key=settings.features_keys.API_KEY_ALPHAVANTAGE,
fred_api_key=settings.features_keys.API_FRED_KEY,
Expand All @@ -229,7 +229,7 @@ def hub2sdk(cls, settings: HubUserSettings) -> Credentials:

@classmethod
def sdk2hub(cls, credentials: Credentials) -> HubUserSettings:
"""Convert SDK models to Hub user settings."""
"""Convert Platform models to Hub user settings."""

def get_cred(cred: str) -> Optional[str]:
return getattr(credentials, cred, None)
Expand Down Expand Up @@ -257,6 +257,6 @@ def check_token_expiration(token: str) -> None:
options={"verify_signature": False, "verify_exp": True},
)
except ExpiredSignatureError as e:
raise OpenBBError("SDK personal access token expired.") from e
raise OpenBBError("Platform personal access token expired.") from e
except JWTError as e:
raise OpenBBError("Failed to decode SDK token.") from e
raise OpenBBError("Failed to decode Platform token.") from e
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def log(self, message: str, **kwargs):


class PackageBuilder:
"""Build the extension package for the SDK."""
"""Build the extension package for the Platform."""

def __init__(
self, directory: Optional[Path] = None, lint: bool = True, verbose: bool = False
Expand All @@ -72,7 +72,7 @@ def build(
self,
modules: Optional[Union[str, List[str]]] = None,
) -> None:
"""Build the extensions for the SDK."""
"""Build the extensions for the Platform."""
self.console.log("\nBuilding extensions package...\n")
self.clean_package(modules)
ext_map = self.get_extension_map()
Expand Down Expand Up @@ -170,7 +170,7 @@ def write_to_package(self, code: str, name: str, extension="py") -> None:


class ModuleBuilder:
"""Build the module for the SDK."""
"""Build the module for the Platform."""

@staticmethod
def build(path: str, ext_map: Optional[Dict[str, List[str]]] = None) -> str:
Expand All @@ -183,7 +183,7 @@ def build(path: str, ext_map: Optional[Dict[str, List[str]]] = None) -> str:


class ImportDefinition:
"""Build the import definition for the SDK."""
"""Build the import definition for the Platform."""

@staticmethod
def filter_hint_type_list(hint_type_list: List[Type]) -> List[Type]:
Expand Down Expand Up @@ -280,7 +280,7 @@ def build(cls, path: str) -> str:


class ClassDefinition:
"""Build the class definition for the SDK."""
"""Build the class definition for the Platform."""

@staticmethod
def build(path: str, ext_map: Optional[Dict[str, List[str]]] = None) -> str:
Expand Down Expand Up @@ -515,7 +515,7 @@ def generate(


class MethodDefinition:
"""Build the method definition for the SDK."""
"""Build the method definition for the Platform."""

@staticmethod
def build_class_loader_method(path: str) -> str:
Expand Down Expand Up @@ -817,7 +817,7 @@ def build_command_method(


class PathHandler:
"""Handle the paths for the SDK."""
"""Handle the paths for the Platform."""

@staticmethod
def build_route_map() -> Dict[str, BaseRoute]:
Expand Down Expand Up @@ -884,7 +884,7 @@ def build_module_class(cls, path: str) -> str:


class Linters:
"""Run the linters for the SDK."""
"""Run the linters for the Platform."""

def __init__(self, directory: Path, verbose: bool = False) -> None:
self.directory = directory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_connect_with_email_password():


def test_connect_with_sdk_token():
"""Test connect with SDK personal access token."""
"""Test connect with Platform personal access token."""
mock_hub_session = MagicMock(spec=HubSession)
with patch(
"requests.post", return_value=MagicMock(status_code=200, json=lambda: {})
Expand Down Expand Up @@ -86,7 +86,7 @@ def test_get_session_from_email_password():


def test_get_session_from_sdk_token():
"""Test get session from SDK personal access token."""
"""Test get session from Platform personal access token."""

with patch(
"openbb_core.app.service.hub_service.post",
Expand Down
2 changes: 1 addition & 1 deletion openbb_platform/providers/alpha_vantage/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenBB Alpha Vantage Provider

This extension integrates the [Alpha Vantage](https://www.alphavantage.co/) data provider into the OpenBB SDK.
This extension integrates the [Alpha Vantage](https://www.alphavantage.co/) data provider into the OpenBB Platform.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion openbb_platform/providers/benzinga/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenBB Benzinga Provider

This extension integrates the [Benzinga](https://www.benzinga.com/) data provider into the OpenBB SDK.
This extension integrates the [Benzinga](https://www.benzinga.com/) data provider into the OpenBB Platform.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion openbb_platform/providers/cboe/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenBB CBOE Provider

This extension integrates the [CBOE](https://www.cboe.com/) data provider into the OpenBB SDK.
This extension integrates the [CBOE](https://www.cboe.com/) data provider into the OpenBB Platform.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion openbb_platform/providers/fmp/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenBB Financial Modeling Prep Provider

This extension integrates the [Financial Modeling Prep](https://site.financialmodelingprep.com/) data provider into the OpenBB SDK.
This extension integrates the [Financial Modeling Prep](https://site.financialmodelingprep.com/) data provider into the OpenBB Platform.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion openbb_platform/providers/fred/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenBB FRED Provider

This extension integrates the [FRED](https://fred.stlouisfed.org/docs/api/fred/) data provider into the OpenBB SDK.
This extension integrates the [FRED](https://fred.stlouisfed.org/docs/api/fred/) data provider into the OpenBB Platform.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion openbb_platform/providers/intrinio/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenBB Intrinio Provider

This extension integrates the [Intrinio](https://intrinio.com/) data provider into the OpenBB SDK.
This extension integrates the [Intrinio](https://intrinio.com/) data provider into the OpenBB Platform.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion openbb_platform/providers/polygon/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenBB Polygon Provider

This extension integrates the [Polygon](https://polygon.io/) data provider into the OpenBB SDK.
This extension integrates the [Polygon](https://polygon.io/) data provider into the OpenBB Platform.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion openbb_platform/providers/quandl/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenBB Quandl Provider

This extension integrates the [Quandl](https://data.nasdaq.com/publishers/QDL) data provider into the OpenBB SDK.
This extension integrates the [Quandl](https://data.nasdaq.com/publishers/QDL) data provider into the OpenBB Platform.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion openbb_platform/providers/yfinance/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenBB Yahoo!Finance Provider

This extension integrates the [Yahoo!Finance](https://finance.yahoo.com/) data provider into the OpenBB SDK.
This extension integrates the [Yahoo!Finance](https://finance.yahoo.com/) data provider into the OpenBB Platform.

## Installation

Expand Down
Loading