From d29ba43ee01c2709f7672f29bd7ea364a348e329 Mon Sep 17 00:00:00 2001 From: Colin Delahunty <72827203+colin99d@users.noreply.github.com> Date: Thu, 17 Nov 2022 08:41:06 +0100 Subject: [PATCH] Top100docs (#3436) --- openbb_terminal/common/feedparser_model.py | 5 +++++ openbb_terminal/economy/econdb_model.py | 10 ++++++++++ openbb_terminal/economy/fred_model.py | 5 +++++ openbb_terminal/economy/wsj_model.py | 10 ++++++++++ openbb_terminal/economy/yfinance_model.py | 6 ++++++ .../stocks/fundamental_analysis/finviz_model.py | 5 +++++ .../stocks/options/alphaquery_model.py | 5 +++++ openbb_terminal/stocks/options/fdscanner_model.py | 5 +++++ openbb_terminal/stocks/stocks_helper.py | 15 +++++++++++++++ 9 files changed, 66 insertions(+) diff --git a/openbb_terminal/common/feedparser_model.py b/openbb_terminal/common/feedparser_model.py index 2e94d809fc4..92a55c83117 100644 --- a/openbb_terminal/common/feedparser_model.py +++ b/openbb_terminal/common/feedparser_model.py @@ -28,6 +28,11 @@ def get_news( ------- articles: pd.DataFrame term to search on the news articles + + Examples + -------- + >>> from openbb_terminal.sdk import openbb + >>> openbb.news() """ # Necessary for installer so that it can locate the correct certificates for # API calls and https diff --git a/openbb_terminal/economy/econdb_model.py b/openbb_terminal/economy/econdb_model.py index f78b4c88d34..70d4482694c 100644 --- a/openbb_terminal/economy/econdb_model.py +++ b/openbb_terminal/economy/econdb_model.py @@ -684,6 +684,11 @@ def get_aggregated_macro_data( A DataFrame with the requested macro data of all chosen countries, A dictionary containing the units of each country's parameter (e.g. EUR), A string denomination which can be Trillions, Billions, Millions, Thousands + + Examples + -------- + >>> from openbb_terminal.sdk import openbb + >>> macro_df = openbb.economy.macro() """ if end_date is None: @@ -756,6 +761,11 @@ def get_treasuries( ------- treasury_data: pd.Dataframe Holds data of the selected types and maturities + + Examples + -------- + >>> from openbb_terminal.sdk import openbb + >>> openbb.economy.treasury() """ if end_date is None: diff --git a/openbb_terminal/economy/fred_model.py b/openbb_terminal/economy/fred_model.py index 070d9deb321..0997fc1ad1a 100644 --- a/openbb_terminal/economy/fred_model.py +++ b/openbb_terminal/economy/fred_model.py @@ -268,6 +268,11 @@ def get_yield_curve( Tuple[pd.DataFrame, datetime] Dataframe of yields and maturities, Date for which the yield curve is obtained + + Examples + -------- + >>> from openbb_terminal.sdk import openbb + >>> ycrv_df = openbb.economy.ycrv() """ fredapi_client = Fred(cfg.API_FRED_KEY) fred_series = { diff --git a/openbb_terminal/economy/wsj_model.py b/openbb_terminal/economy/wsj_model.py index 1d72ac6d704..e398db48b48 100644 --- a/openbb_terminal/economy/wsj_model.py +++ b/openbb_terminal/economy/wsj_model.py @@ -66,6 +66,11 @@ def market_overview() -> pd.DataFrame: ------- overview: pd.DataFrame Dataframe containing name, price, net change and percent change + + Examples + -------- + >>> from openbb_terminal.sdk import openbb + >>> ov_df = openbb.economy.overview() """ url = ( "https://www.wsj.com/market-data?id=%7B%22application%22%3A%22WSJ%22%2C%22instruments%22%3A%5B%7B%22symbol%22" @@ -107,6 +112,11 @@ def top_commodities() -> pd.DataFrame: ------- commodities: pd.DataFrame Dataframe containing name, price, net change and percent change + + Examples + -------- + >>> from openbb_terminal.sdk import openbb + >>> fut_df = openbb.economy.futures() """ url = ( "https://www.wsj.com/market-data/commodities?id=%7B%22application%22%3A%22WSJ%22%2C%22instruments%22%3A%5B%7" diff --git a/openbb_terminal/economy/yfinance_model.py b/openbb_terminal/economy/yfinance_model.py index 760a54015e1..3652c15b204 100644 --- a/openbb_terminal/economy/yfinance_model.py +++ b/openbb_terminal/economy/yfinance_model.py @@ -700,6 +700,12 @@ def get_indices( ------- pd.Dataframe Dataframe with historical data on selected indices. + + Examples + -------- + >>> from openbb_terminal.sdk import openbb + >>> openbb.economy.available_indices() + >>> openbb.economy.index(["^GSPC", "sp400"]) """ indices_data: pd.DataFrame = pd.DataFrame() diff --git a/openbb_terminal/stocks/fundamental_analysis/finviz_model.py b/openbb_terminal/stocks/fundamental_analysis/finviz_model.py index 8be8a7a8cbd..b702b13b05a 100644 --- a/openbb_terminal/stocks/fundamental_analysis/finviz_model.py +++ b/openbb_terminal/stocks/fundamental_analysis/finviz_model.py @@ -24,6 +24,11 @@ def get_data(symbol: str) -> pd.DataFrame: ------- pd.DataFrame DataFrame of fundamental data + + Examples + -------- + >>> from openbb_terminal.sdk import openbb + >>> openbb.stocks.fa.data("IWV") """ d_finviz_stock = finviz.get_stock(symbol) df_fa = pd.DataFrame.from_dict(d_finviz_stock, orient="index", columns=["Values"]) diff --git a/openbb_terminal/stocks/options/alphaquery_model.py b/openbb_terminal/stocks/options/alphaquery_model.py index 94e38dbbe39..8f3807b09a0 100644 --- a/openbb_terminal/stocks/options/alphaquery_model.py +++ b/openbb_terminal/stocks/options/alphaquery_model.py @@ -33,6 +33,11 @@ def get_put_call_ratio( ------- pd.DataFrame Put call ratio + + Examples + -------- + >>> from openbb_terminal.sdk import openbb + >>> pcr_df = openbb.stocks.options.pcr("B") """ if start_date is None: diff --git a/openbb_terminal/stocks/options/fdscanner_model.py b/openbb_terminal/stocks/options/fdscanner_model.py index 299a7564c8f..2b388ca974a 100644 --- a/openbb_terminal/stocks/options/fdscanner_model.py +++ b/openbb_terminal/stocks/options/fdscanner_model.py @@ -28,6 +28,11 @@ def unusual_options(limit: int = 100) -> Tuple[pd.DataFrame, pd.Timestamp]: ------- Tuple[pd.DataFrame, pd.Timestamp] Dataframe containing options information, Timestamp indicated when data was updated from website + + Examples + -------- + >>> from openbb_terminal.sdk import openbb + >>> unu_df = openbb.stocks.options.unu() """ pages = np.arange(0, limit // 20 + 1) data_list = [] diff --git a/openbb_terminal/stocks/stocks_helper.py b/openbb_terminal/stocks/stocks_helper.py index 42aa1df6362..c4f0a44139b 100644 --- a/openbb_terminal/stocks/stocks_helper.py +++ b/openbb_terminal/stocks/stocks_helper.py @@ -122,6 +122,11 @@ def search( The limit of companies shown. export : str Export data + + Examples + -------- + >>> from openbb_terminal.sdk import openbb + >>> openbb.stocks.search(country="united states", exchange_country="Germany") """ kwargs: Dict[str, Any] = {"exclude_exchanges": False} if country: @@ -499,6 +504,11 @@ def display_candle( Flag to display raw data, by default False yscale: str Linear or log for yscale + + Examples + -------- + >>> from openbb_terminal.sdk import openbb + >>> openbb.stocks.candle("AAPL") """ if start_date is None: @@ -792,6 +802,11 @@ def load_ticker( DataFrame A Panda's data frame with columns Open, High, Low, Close, Adj Close, Volume, date_id, OC-High, OC-Low. + + Examples + -------- + >>> from openbb_terminal.sdk import openbb + >>> msft_df = openbb.stocks.load("MSFT") """ df_data = yf.download(ticker, start=start_date, end=end_date, progress=False)