mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 12:40:35 +00:00
Fix linter issue (#3538)
* Fix linter issue * Didnt import optimization menu * Fix some things for deployment * openbbterminal -> openbb * openbb
This commit is contained in:
2
.github/workflows/gh-pages.yml
vendored
2
.github/workflows/gh-pages.yml
vendored
@@ -38,7 +38,7 @@ jobs:
|
||||
run: poetry install --no-interaction --no-root
|
||||
|
||||
- name: Install packages
|
||||
run: poetry install --no-interaction -E prediction -E doc
|
||||
run: poetry install --no-interaction -E prediction -E doc -E optimization
|
||||
|
||||
- run: |
|
||||
source $VENV
|
||||
|
||||
2
openbb_terminal/SDK_README.md
vendored
2
openbb_terminal/SDK_README.md
vendored
@@ -80,7 +80,7 @@ conda activate obb
|
||||
#### 4. **Install OpenBB SDK Core package**
|
||||
|
||||
```bash
|
||||
pip install openbbterminal
|
||||
pip install openbb
|
||||
```
|
||||
|
||||
#### 5. **(Optional) Install the Toolkits**
|
||||
|
||||
@@ -1,40 +1,39 @@
|
||||
"""Cryptocurrency helpers"""
|
||||
# pylint: disable=too-many-lines,too-many-return-statements
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import json
|
||||
from datetime import datetime, timedelta
|
||||
import difflib
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
from datetime import datetime, timedelta
|
||||
from typing import Union
|
||||
|
||||
import pandas as pd
|
||||
import numpy as np
|
||||
import ccxt
|
||||
import matplotlib.pyplot as plt
|
||||
from matplotlib.ticker import LogLocator, ScalarFormatter
|
||||
import yfinance as yf
|
||||
import mplfinance as mpf
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
import yfinance as yf
|
||||
from matplotlib.ticker import LogLocator, ScalarFormatter
|
||||
from pycoingecko import CoinGeckoAPI
|
||||
|
||||
from openbb_terminal.helper_funcs import (
|
||||
lambda_long_number_format,
|
||||
plot_autoscale,
|
||||
export_data,
|
||||
print_rich_table,
|
||||
lambda_long_number_format_y_axis,
|
||||
is_valid_axes_count,
|
||||
)
|
||||
from openbb_terminal.config_plot import PLOT_DPI
|
||||
from openbb_terminal.config_terminal import theme
|
||||
from openbb_terminal.rich_config import console
|
||||
from openbb_terminal.cryptocurrency.due_diligence import coinpaprika_model
|
||||
from openbb_terminal.cryptocurrency.discovery import pycoingecko_model
|
||||
from openbb_terminal.cryptocurrency.due_diligence import coinpaprika_model
|
||||
from openbb_terminal.cryptocurrency.due_diligence.pycoingecko_model import (
|
||||
get_ohlc,
|
||||
get_coin_tokenomics,
|
||||
get_ohlc,
|
||||
)
|
||||
from openbb_terminal.helper_funcs import (
|
||||
export_data,
|
||||
is_valid_axes_count,
|
||||
lambda_long_number_format,
|
||||
lambda_long_number_format_y_axis,
|
||||
plot_autoscale,
|
||||
print_rich_table,
|
||||
)
|
||||
from openbb_terminal.rich_config import console
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -115,13 +114,13 @@ YF_CURRENCY = [
|
||||
|
||||
|
||||
def check_datetime(
|
||||
ck_date: datetime | str | None = None, start: bool = True
|
||||
ck_date: Union[datetime, Union[str, None]] = None, start: bool = True
|
||||
) -> datetime:
|
||||
"""Checks if given argument is string and attempts to convert to datetime.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
ck_date : Optional[Union[datetime, str]], optional
|
||||
ck_date : Union[datetime, Union[str, None]], optional
|
||||
Date to check, by default None
|
||||
start : bool, optional
|
||||
If True and string is invalid, will return 1100 days ago
|
||||
@@ -488,11 +487,11 @@ def load_from_yahoofinance(
|
||||
|
||||
def load(
|
||||
symbol: str,
|
||||
start_date: datetime | str | None = None,
|
||||
interval: str | int = "1440",
|
||||
start_date: Union[datetime, Union[str, None]] = None,
|
||||
interval: Union[str, int] = "1440",
|
||||
exchange: str = "binance",
|
||||
vs_currency: str = "usdt",
|
||||
end_date: datetime | str | None = None,
|
||||
end_date: Union[datetime, Union[str, None]] = None,
|
||||
source: str = "CCXT",
|
||||
) -> pd.DataFrame:
|
||||
"""Load crypto currency to get data for
|
||||
@@ -501,16 +500,16 @@ def load(
|
||||
----------
|
||||
symbol: str
|
||||
Coin to get
|
||||
start_date: str or datetime, optional
|
||||
start_date: Union[datetime, Union[str, None]], optional
|
||||
Start date to get data from with. - datetime or string format (YYYY-MM-DD)
|
||||
interval: str|int
|
||||
interval: Union[str, int]
|
||||
The interval between data points in minutes.
|
||||
Choose from: 1, 15, 30, 60, 240, 1440, 10080, 43200
|
||||
exchange: str:
|
||||
The exchange to get data from.
|
||||
vs_currency: str
|
||||
Quote Currency (Defaults to usdt)
|
||||
end_date: str or datetime, optional
|
||||
end_date: Union[datetime, Union[str, None]], optional
|
||||
End date to get data from with. - datetime or string format (YYYY-MM-DD)
|
||||
source: str
|
||||
The source of the data
|
||||
@@ -752,7 +751,7 @@ def plot_chart(
|
||||
source: str = "",
|
||||
exchange: str = "",
|
||||
interval: str = "",
|
||||
external_axes: list[plt.Axes] | None = None,
|
||||
external_axes: Union[list[plt.Axes], None] = None,
|
||||
yscale: str = "linear",
|
||||
) -> None:
|
||||
"""Load data for Technical Analysis
|
||||
@@ -802,7 +801,7 @@ def plot_candles(
|
||||
volume: bool = True,
|
||||
ylabel: str = "",
|
||||
title: str = "",
|
||||
external_axes: list[plt.Axes] | None = None,
|
||||
external_axes: Union[list[plt.Axes], None] = None,
|
||||
yscale: str = "linear",
|
||||
) -> None:
|
||||
"""Plot candle chart from dataframe. [Source: Binance]
|
||||
@@ -882,7 +881,7 @@ def plot_order_book(
|
||||
bids: np.ndarray,
|
||||
asks: np.ndarray,
|
||||
coin: str,
|
||||
external_axes: list[plt.Axes] | None = None,
|
||||
external_axes: Union[list[plt.Axes], None] = None,
|
||||
) -> None:
|
||||
"""
|
||||
Plots Bid/Ask. Can be used for Coinbase and Binance
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
"""Chartexchange model"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
from typing import Union
|
||||
|
||||
import pandas as pd
|
||||
import requests
|
||||
@@ -21,7 +20,7 @@ def get_option_history(
|
||||
symbol: str = "GME",
|
||||
date: str = "2021-02-05",
|
||||
call: bool = True,
|
||||
price: str | int | float = "90",
|
||||
price: Union[str, Union[int, float]] = "90",
|
||||
) -> pd.DataFrame:
|
||||
"""Historic prices for a specific option [chartexchange]
|
||||
|
||||
@@ -29,11 +28,11 @@ def get_option_history(
|
||||
----------
|
||||
symbol : str
|
||||
Ticker symbol to get historical data from
|
||||
date : str|int|float
|
||||
date : str
|
||||
Date as a string YYYYMMDD
|
||||
call : bool
|
||||
Whether to show a call or a put
|
||||
price : str
|
||||
price : Union[str, Union[int, float]]
|
||||
Strike price for a specific option
|
||||
|
||||
Returns
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
"""Options Functions For OpenBB SDK"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
from typing import Union
|
||||
|
||||
import pandas as pd
|
||||
|
||||
from openbb_terminal.decorators import log_start_end
|
||||
from openbb_terminal.stocks.options import (
|
||||
chartexchange_model,
|
||||
nasdaq_model,
|
||||
tradier_model,
|
||||
yfinance_model,
|
||||
chartexchange_model,
|
||||
)
|
||||
from openbb_terminal.decorators import log_start_end
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@log_start_end(log=logger)
|
||||
def get_full_option_chain(
|
||||
symbol: str, source: str = "Nasdaq", expiration: str | None = None
|
||||
symbol: str, source: str = "Nasdaq", expiration: Union[str, None] = None
|
||||
) -> pd.DataFrame:
|
||||
"""Get Option Chain For A Stock. No greek data is returned
|
||||
|
||||
@@ -28,7 +28,7 @@ def get_full_option_chain(
|
||||
Symbol to get chain for
|
||||
source : str, optional
|
||||
Source to get data from, by default "Nasdaq"
|
||||
expiration : str, optional
|
||||
expiration : Union[str, None], optional
|
||||
Date to get chain for. By default returns all dates
|
||||
|
||||
Returns
|
||||
@@ -101,7 +101,7 @@ def get_option_expirations(symbol: str, source: str = "Nasdaq") -> list:
|
||||
def hist(
|
||||
symbol: str,
|
||||
exp: str,
|
||||
strike: int | float | str,
|
||||
strike: Union[int, Union[float, str]],
|
||||
call: bool = True,
|
||||
source="ChartExchange",
|
||||
) -> pd.DataFrame:
|
||||
@@ -113,7 +113,7 @@ def hist(
|
||||
Symbol to get data for
|
||||
exp : str
|
||||
Expiration date
|
||||
strike : int | float | str
|
||||
strike : Union[int ,Union[float,str]]
|
||||
Strike price
|
||||
call : bool, optional
|
||||
Flag to indicate a call, by default True
|
||||
|
||||
@@ -228,7 +228,6 @@ def check_for_updates() -> None:
|
||||
|
||||
if current_version_number == latest_version_number:
|
||||
console.print("[green]You are using the latest stable version[/green]")
|
||||
return
|
||||
else:
|
||||
console.print(
|
||||
"[yellow]You are not using the latest stable version[/yellow]"
|
||||
@@ -237,10 +236,12 @@ def check_for_updates() -> None:
|
||||
console.print(
|
||||
"[yellow]Check for updates at https://openbb.co/products/terminal#get-started[/yellow]"
|
||||
)
|
||||
|
||||
else:
|
||||
console.print(
|
||||
"[yellow]You are using an unreleased version[/yellow]"
|
||||
)
|
||||
|
||||
else:
|
||||
console.print("[red]You are using an unrecognized version.[/red]")
|
||||
else:
|
||||
|
||||
2
pyproject.toml
vendored
2
pyproject.toml
vendored
@@ -1,5 +1,5 @@
|
||||
[tool.poetry]
|
||||
name = "OpenBBTerminal"
|
||||
name = "openbb"
|
||||
version = "2.0.0rc1"
|
||||
description = "Investment Research for Everyone, Anywhere."
|
||||
license = "MIT"
|
||||
|
||||
@@ -33,7 +33,7 @@ conda activate obb
|
||||
### 4. **Install OpenBB SDK Core package**
|
||||
|
||||
```bash
|
||||
pip install openbbterminal
|
||||
pip install openbb
|
||||
```
|
||||
|
||||
### 5. **(Optional) Install the Toolkits**
|
||||
|
||||
Reference in New Issue
Block a user