Skip to content

Commit

Permalink
[BugFix] - Remove logos (#6404)
Browse files Browse the repository at this point in the history
* fix: remove logos

* fix: remove from provider

* feat: add extra field

* rename
  • Loading branch information
montezdesousa authored May 13, 2024
1 parent f47e7ad commit 627f7f9
Show file tree
Hide file tree
Showing 30 changed files with 94 additions and 99 deletions.
1 change: 1 addition & 0 deletions assets/extensions/obbject.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[
{
"packageName": "openbb-charting",
"optional": true,
"description": "Create custom charts from OBBject data."
}
]
97 changes: 49 additions & 48 deletions assets/extensions/provider.json

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions assets/extensions/router.json
Original file line number Diff line number Diff line change
@@ -1,58 +1,72 @@
[
{
"packageName": "openbb-commodity",
"optional": false,
"description": "Commodity market data."
},
{
"packageName": "openbb-crypto",
"optional": false,
"description": "Cryptocurrency market data."
},
{
"packageName": "openbb-currency",
"optional": false,
"description": "Foreign exchange (FX) market data."
},
{
"packageName": "openbb-derivatives",
"optional": false,
"description": "Derivatives market data."
},
{
"packageName": "openbb-econometrics",
"optional": true,
"description": "Econometrics analysis tools."
},
{
"packageName": "openbb-economy",
"optional": false,
"description": "Economic data."
},
{
"packageName": "openbb-equity",
"optional": false,
"description": "Equity market data."
},
{
"packageName": "openbb-etf",
"optional": false,
"description": "Exchange Traded Funds market data."
},
{
"packageName": "openbb-fixedincome",
"optional": false,
"description": "Fixed Income market data."
},
{
"packageName": "openbb-index",
"optional": false,
"description": "Indices data."
},
{
"packageName": "openbb-news",
"optional": false,
"description": "Financial market news data."
},
{
"packageName": "openbb-quantitative",
"optional": true,
"description": "Quantitative analysis tools."
},
{
"packageName": "openbb-regulators",
"optional": false,
"description": "Financial market regulators data."
},
{
"packageName": "openbb-technical",
"optional": true,
"description": "Technical Analysis tools."
}
]
51 changes: 29 additions & 22 deletions assets/scripts/generate_extension_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
from poetry.core.pyproject.toml import PyProjectTOML

THIS_DIR = Path(__file__).parent
PROVIDERS_PATH = Path(THIS_DIR, "..", "..", "openbb_platform/providers")
EXTENSIONS_PATH = Path(THIS_DIR, "..", "..", "openbb_platform/extensions")
OBBJECT_EXTENSIONS_PATH = Path(
THIS_DIR, "..", "..", "openbb_platform/obbject_extensions"
)
OPENBB_PLATFORM_PATH = Path(THIS_DIR, "..", "..", "openbb_platform")
PROVIDERS_PATH = OPENBB_PLATFORM_PATH / "providers"
EXTENSIONS_PATH = OPENBB_PLATFORM_PATH / "extensions"
OBBJECT_EXTENSIONS_PATH = OPENBB_PLATFORM_PATH / "obbject_extensions"

OPENBB_PLATFORM_TOML = PyProjectTOML(OPENBB_PLATFORM_PATH / "pyproject.toml")


def to_title(string: str) -> str:
Expand All @@ -30,7 +31,7 @@ def get_packages(path: Path, plugin_key: str) -> Dict[str, Any]:
poetry = pyproject.data["tool"]["poetry"]
name = poetry["name"]
plugin = poetry.get("plugins", {}).get(plugin_key)
packages[name] = list(plugin.values())[0] if plugin else ""
packages[name] = {"plugin": list(plugin.values())[0] if plugin else ""}
return packages


Expand All @@ -46,66 +47,72 @@ def to_camel(string: str):
return components[0] + "".join(x.title() for x in components[1:])


def createItem(package_name: str, obj: object, attrs: List[str]) -> Dict[str, str]:
def createItem(package_name: str, obj: object, obj_attrs: List[str]) -> Dict[str, Any]:
"""Create dictionary item from object attributes."""
item = {"packageName": package_name}
pkg_spec = OPENBB_PLATFORM_TOML.data["tool"]["poetry"]["dependencies"].get(
package_name
)
optional = pkg_spec.get("optional", False) if isinstance(pkg_spec, dict) else False
item = {"packageName": package_name, "optional": optional}
item.update(
{to_camel(a): getattr(obj, a) for a in attrs if getattr(obj, a) is not None}
{to_camel(a): getattr(obj, a) for a in obj_attrs if getattr(obj, a) is not None}
)
return item


def generate_provider_extensions() -> None:
"""Generate providers_extensions.json."""
packages = get_packages(PROVIDERS_PATH, "openbb_provider_extension")
data: List[Dict[str, str]] = []
attrs = [
data: List[Dict[str, Any]] = []
obj_attrs = [
"repr_name",
"description",
"credentials",
"v3_credentials",
"website",
"instructions",
"logo_url",
]

for pkg_name, plugin in sorted(packages.items()):
for pkg_name, details in sorted(packages.items()):
plugin = details.get("plugin", "")
file_obj = plugin.split(":")
if len(file_obj) == 2:
file, obj = file_obj[0], file_obj[1]
module = import_module(file)
provider_obj = getattr(module, obj)
data.append(createItem(pkg_name, provider_obj, attrs))
data.append(createItem(pkg_name, provider_obj, obj_attrs))
write("provider", data)


def generate_router_extensions() -> None:
"""Generate router_extensions.json."""
packages = get_packages(EXTENSIONS_PATH, "openbb_core_extension")
data: List[Dict[str, str]] = []
attrs = ["description"]
for pkg_name, plugin in sorted(packages.items()):
data: List[Dict[str, Any]] = []
obj_attrs = ["description"]
for pkg_name, details in sorted(packages.items()):
plugin = details.get("plugin", "")
file_obj = plugin.split(":")
if len(file_obj) == 2:
file, obj = file_obj[0], file_obj[1]
module = import_module(file)
router_obj = getattr(module, obj)
data.append(createItem(pkg_name, router_obj, attrs))
data.append(createItem(pkg_name, router_obj, obj_attrs))
write("router", data)


def generate_obbject_extensions() -> None:
"""Generate obbject_extensions.json."""
packages = get_packages(OBBJECT_EXTENSIONS_PATH, "openbb_obbject_extension")
data: List[Dict[str, str]] = []
attrs = ["description"]
for pkg_name, plugin in sorted(packages.items()):
data: List[Dict[str, Any]] = []
obj_attrs = ["description"]
for pkg_name, details in sorted(packages.items()):
plugin = details.get("plugin", "")
file_obj = plugin.split(":")
if len(file_obj) == 2:
file, obj = file_obj[0], file_obj[1]
module = import_module(file)
ext_obj = getattr(module, obj)
data.append(createItem(pkg_name, ext_obj, attrs))
data.append(createItem(pkg_name, ext_obj, obj_attrs))
write("obbject", data)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def hub2platform(self, settings: HubUserSettings) -> Credentials:
}
msg = ""
for k, v in deprecated.items():
msg += f"\n'{k}' -> '{v}', "
msg += f"\n'{k}' -> '{v.upper()}', "
msg = msg.strip(", ")
warn(
message=f"\nDeprecated v3 credentials found.\n{msg}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def __init__(
repr_name: Optional[str] = None,
v3_credentials: Optional[List[str]] = None,
instructions: Optional[str] = None,
logo_url: Optional[str] = None,
) -> None:
"""Initialize the provider.
Expand All @@ -41,8 +40,6 @@ def __init__(
List of corresponding v3 credentials, by default None.
instructions: Optional[str]
Instructions on how to setup the provider. For example, how to get an API key.
logo_url: Optional[str]
Provider logo URL.
"""
self.name = name
self.description = description
Expand All @@ -57,4 +54,3 @@ def __init__(
self.repr_name = repr_name
self.v3_credentials = v3_credentials
self.instructions = instructions
self.logo_url = logo_url
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@
"PriceTarget": BenzingaPriceTargetFetcher,
},
repr_name="Benzinga",
logo_url="https://www.benzinga.com/sites/all/themes/bz2/images/Benzinga-logo-navy.svg",
)
1 change: 0 additions & 1 deletion openbb_platform/providers/biztoc/openbb_biztoc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,4 @@
repr_name="BizToc",
v3_credentials=["API_BIZTOC_TOKEN"],
instructions="The BizToc API is hosted on RapidAPI. To set up, go to: https://rapidapi.com/thma/api/biztoc.\n\n![biztoc0](https://github.com/marban/OpenBBTerminal/assets/18151143/04cdd423-f65e-4ad8-ad5a-4a59b0f5ddda)\n\nIn the top right, select 'Sign Up'. After answering some questions, you will be prompted to select one of their plans.\n\n![biztoc1](https://github.com/marban/OpenBBTerminal/assets/18151143/9f3b72ea-ded7-48c5-aa33-bec5c0de8422)\n\nAfter signing up, navigate back to https://rapidapi.com/thma/api/biztoc. If you are logged in, you will see a header called X-RapidAPI-Key.\n\n![biztoc2](https://github.com/marban/OpenBBTerminal/assets/18151143/0f3b6c91-07e0-447a-90cd-a9e23522929f)", # noqa: E501 pylint: disable=line-too-long
logo_url="https://c.biztoc.com/274/logo.svg",
)
1 change: 0 additions & 1 deletion openbb_platform/providers/cboe/openbb_cboe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,4 @@
"OptionsChains": CboeOptionsChainsFetcher,
},
repr_name="Chicago Board Options Exchange (CBOE)",
logo_url="https://upload.wikimedia.org/wikipedia/commons/thumb/8/8a/Cboe_Global_Markets_Logo.svg/2880px-Cboe_Global_Markets_Logo.svg.png", # noqa: E501 pylint: disable=line-too-long
)
1 change: 0 additions & 1 deletion openbb_platform/providers/ecb/openbb_ecb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@
"EUYieldCurve": ECBEUYieldCurveFetcher,
},
repr_name="European Central Bank (ECB)",
logo_url="https://upload.wikimedia.org/wikipedia/commons/thumb/c/cb/Logo_European_Central_Bank.svg/720px-Logo_European_Central_Bank.svg.png", # noqa: E501 pylint: disable=line-too-long
)
1 change: 0 additions & 1 deletion openbb_platform/providers/econdb/openbb_econdb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@
"EconomicIndicators": EconDbEconomicIndicatorsFetcher,
},
repr_name="EconDB",
logo_url="https://avatars.githubusercontent.com/u/21289885?v=4",
)
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@
"FEDFUNDS": FederalReserveFEDFetcher,
},
repr_name="Federal Reserve (FED)",
logo_url="https://upload.wikimedia.org/wikipedia/commons/thumb/1/1a/Seal_of_the_United_States_Federal_Reserve_System.svg/498px-Seal_of_the_United_States_Federal_Reserve_System.svg.png", # noqa: E501 pylint: disable=line-too-long
)
1 change: 0 additions & 1 deletion openbb_platform/providers/finra/openbb_finra/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@
"EquityShortInterest": FinraShortInterestFetcher,
},
repr_name="Financial Industry Regulatory Authority (FINRA)",
logo_url="https://upload.wikimedia.org/wikipedia/commons/thumb/9/95/FINRA_logo.svg/1024px-FINRA_logo.svg.png",
)
1 change: 0 additions & 1 deletion openbb_platform/providers/finviz/openbb_finviz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@
"PriceTarget": FinvizPriceTargetFetcher,
},
repr_name="FinViz",
logo_url="https://finviz.com/img/logo_3_2x.png",
)
1 change: 0 additions & 1 deletion openbb_platform/providers/fmp/openbb_fmp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,4 @@
repr_name="Financial Modeling Prep (FMP)",
v3_credentials=["API_KEY_FINANCIALMODELINGPREP"],
instructions='Go to: https://site.financialmodelingprep.com/developer/docs\n\n![FinancialModelingPrep](https://user-images.githubusercontent.com/46355364/207821920-64553d05-d461-4984-b0fe-be0368c71186.png)\n\nClick on, "Get my API KEY here", and sign up for a free account.\n\n![FinancialModelingPrep](https://user-images.githubusercontent.com/46355364/207822184-a723092e-ef42-4f87-8c55-db150f09741b.png)\n\nWith an account created, sign in and navigate to the Dashboard, which shows the assigned token. by pressing the "Dashboard" button which will show the API key.\n\n![FinancialModelingPrep](https://user-images.githubusercontent.com/46355364/207823170-dd8191db-e125-44e5-b4f3-2df0e115c91d.png)', # noqa: E501 pylint: disable=line-too-long
logo_url="https://intelligence.financialmodelingprep.com//images/fmp-brain-original.svg",
)
1 change: 0 additions & 1 deletion openbb_platform/providers/fred/openbb_fred/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,4 @@
repr_name="Federal Reserve Economic Data | St. Louis FED (FRED)",
v3_credentials=["API_FRED_KEY"],
instructions='Go to: https://fred.stlouisfed.org\n\n![FRED](https://user-images.githubusercontent.com/46355364/207827137-d143ba4c-72cb-467d-a7f4-5cc27c597aec.png)\n\nClick on, "My Account", create a new account or sign in with Google:\n\n![FRED](https://user-images.githubusercontent.com/46355364/207827011-65cdd501-27e3-436f-bd9d-b0d8381d46a7.png)\n\nAfter completing the sign-up, go to "My Account", and select "API Keys". Then, click on, "Request API Key".\n\n![FRED](https://user-images.githubusercontent.com/46355364/207827577-c869f989-4ef4-4949-ab57-6f3931f2ae9d.png)\n\nFill in the box for information about the use-case for FRED, and by clicking, "Request API key", at the bottom of the page, the API key will be issued.\n\n![FRED](https://user-images.githubusercontent.com/46355364/207828032-0a32d3b8-1378-4db2-9064-aa1eb2111632.png)', # noqa: E501 pylint: disable=line-too-long
logo_url="https://fred.stlouisfed.org/images/fred-logo-2x.png",
)
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@
"TreasuryPrices": GovernmentUSTreasuryPricesFetcher,
},
repr_name="Data.gov | United States Government",
logo_url="https://upload.wikimedia.org/wikipedia/commons/0/06/Muq55HrN_400x400.png",
)
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,4 @@
repr_name="Intrinio",
v3_credentials=["API_INTRINIO_KEY"],
instructions="Go to: https://intrinio.com/starter-plan\n\n![Intrinio](https://user-images.githubusercontent.com/85772166/219207556-fcfee614-59f1-46ae-bff4-c63dd2f6991d.png)\n\nAn API key will be issued with a subscription. Find the token value within the account dashboard.", # noqa: E501 pylint: disable=line-too-long
logo_url="https://assets-global.website-files.com/617960145ff34fe4a9fe7240/617960145ff34f9a97fe72c8_Intrinio%20Logo%20-%20Dark.svg",
)
1 change: 0 additions & 1 deletion openbb_platform/providers/nasdaq/openbb_nasdaq/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,4 @@
repr_name="NASDAQ",
v3_credentials=["API_KEY_QUANDL"],
instructions='Go to: https://www.quandl.com\n\n![Quandl](https://user-images.githubusercontent.com/46355364/207823899-208a3952-f557-4b73-aee6-64ac00faedb7.png)\n\nClick on, "Sign Up", and register a new account.\n\n![Quandl](https://user-images.githubusercontent.com/46355364/207824214-4b6b2b74-e709-4ed4-adf2-14803e6f3568.png)\n\nFollow the sign-up instructions, and upon completion the API key will be assigned.\n\n![Quandl](https://user-images.githubusercontent.com/46355364/207824664-3c82befb-9c69-42df-8a82-510d85c19a97.png)', # noqa: E501 pylint: disable=line-too-long
logo_url="https://upload.wikimedia.org/wikipedia/commons/thumb/7/76/NASDAQ_logo.svg/1600px-NASDAQ_logo.svg.png",
)
1 change: 0 additions & 1 deletion openbb_platform/providers/oecd/openbb_oecd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@
"LTIR": OECDLTIRFetcher,
},
repr_name="Organization for Economic Co-operation and Development (OECD)",
logo_url="https://upload.wikimedia.org/wikipedia/commons/thumb/a/a2/OECD_logo.svg/400px-OECD_logo.svg.png",
)
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,4 @@
repr_name="Polygon.io",
v3_credentials=["API_POLYGON_KEY"],
instructions='Go to: https://polygon.io\n\n![Polygon](https://user-images.githubusercontent.com/46355364/207825623-fcd7f0a3-131a-4294-808c-754c13e38e2a.png)\n\nClick on, "Get your Free API Key".\n\n![Polygon](https://user-images.githubusercontent.com/46355364/207825952-ca5540ec-6ed2-4cef-a0ed-bb50b813932c.png)\n\nAfter signing up, the API Key is found at the bottom of the account dashboard page.\n\n![Polygon](https://user-images.githubusercontent.com/46355364/207826258-b1f318fa-fd9c-41d9-bf5c-fe16722e6601.png)', # noqa: E501 pylint: disable=line-too-long
logo_url="https://polygon.io/_next/image?url=%2Flogo.svg&w=640&q=75",
)
1 change: 0 additions & 1 deletion openbb_platform/providers/sec/openbb_sec/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,4 @@
"SymbolMap": SecSymbolMapFetcher,
},
repr_name="Securities and Exchange Commission (SEC)",
logo_url="https://upload.wikimedia.org/wikipedia/commons/thumb/1/1c/Seal_of_the_United_States_Securities_and_Exchange_Commission.svg/1920px-Seal_of_the_United_States_Securities_and_Exchange_Commission.svg.png", # noqa: E501 pylint: disable=line-too-long
)
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@
"UpcomingReleaseDays": SAUpcomingReleaseDaysFetcher,
},
repr_name="Seeking Alpha",
logo_url="https://upload.wikimedia.org/wikipedia/commons/thumb/e/e0/Seeking_Alpha_Logo.svg/280px-Seeking_Alpha_Logo.svg.png",
)
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@
"ShortVolume": StockgridShortVolumeFetcher,
},
repr_name="Stockgrid",
logo_url="https://www.stockgrid.io/img/logo_white2.41ee5250.svg",
)
1 change: 0 additions & 1 deletion openbb_platform/providers/tiingo/openbb_tiingo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@
"TrailingDividendYield": TiingoTrailingDivYieldFetcher,
},
repr_name="Tiingo",
logo_url="https://www.tiingo.com/dist/images/tiingo/logos/tiingo_full_light_color.svg",
)
1 change: 0 additions & 1 deletion openbb_platform/providers/tmx/openbb_tmx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,4 @@
"TreasuryPrices": TmxTreasuryPricesFetcher,
},
repr_name="TMX",
logo_url="https://www.tmx.com/assets/application/img/tmx_logo_en.1593799726.svg",
)
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@
repr_name="Tradier",
v3_credentials=["API_TRADIER_TOKEN"],
instructions='Go to: https://documentation.tradier.com\n\n![Tradier](https://user-images.githubusercontent.com/46355364/207829178-a8bba770-f2ea-4480-b28e-efd81cf30980.png)\n\nClick on, "Open Account", to start the sign-up process. After the account has been setup, navigate to [Tradier Broker Dash](https://dash.tradier.com/login?redirect=settings.api) and create the application. Request a sandbox access token.', # noqa: E501 pylint: disable=line-too-long
logo_url="https://tradier.com/assets/images/tradier-logo.svg",
)
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@
credentials=["api_key"],
fetcher_dict={"EconomicCalendar": TEEconomicCalendarFetcher},
repr_name="Trading Economics",
logo_url="https://developer.tradingeconomics.com/Content/Images/logo.svg",
)
1 change: 0 additions & 1 deletion openbb_platform/providers/wsj/openbb_wsj/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,4 @@
"ETFActive": WSJActiveFetcher,
},
repr_name="Wall Street Journal (WSJ)",
logo_url="https://upload.wikimedia.org/wikipedia/commons/thumb/4/4a/WSJ_Logo.svg/1594px-WSJ_Logo.svg.png",
)
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,4 @@
"ShareStatistics": YFinanceShareStatisticsFetcher,
},
repr_name="Yahoo Finance",
logo_url="https://upload.wikimedia.org/wikipedia/commons/8/8f/Yahoo%21_Finance_logo_2021.png",
)

0 comments on commit 627f7f9

Please sign in to comment.