From 69745672605f841fef97268c40da32bbc45d9575 Mon Sep 17 00:00:00 2001 From: Jamie Date: Wed, 17 Mar 2021 14:50:05 -0400 Subject: [PATCH] change options + README --- gamestonk_terminal/fred/README.md | 9 +++++++-- gamestonk_terminal/fred/fred_api.py | 18 ++++++++++-------- gamestonk_terminal/fred/fred_menu.py | 16 ++++++++++------ 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/gamestonk_terminal/fred/README.md b/gamestonk_terminal/fred/README.md index 51b71a957fb..f781a1ac1e4 100644 --- a/gamestonk_terminal/fred/README.md +++ b/gamestonk_terminal/fred/README.md @@ -14,8 +14,9 @@ The current predefined options are * 1,5,10,30 Year Treasury Rates * 30 Year Mortgage Rates * Unemployment Rate -* 3 Month LIBOR +* Effective Federal Funds rate * Moody's AAA Corporate Bond +* CAD to USD Conversion. ## predefined ```text @@ -31,6 +32,9 @@ To plot the 30-Year Mortgage rates since 2018-01-01 suppressing the output. ```` mort30 -s 2018-01-01 --hidedata ```` + +![mort30](https://user-images.githubusercontent.com/18151143/111521185-3d80dc80-872f-11eb-989d-c2bb256aa213.png) + To show all GDP data since 1/1/2016, with no plot. ```` gdp -s 2016-01-01 --noplot @@ -78,9 +82,10 @@ An example of custom data could be the USD/EURO exchange rate. According to https://fred.stlouisfed.org/series/DEXUSEU , the series ID is DEXUSEU. So to plot this from the start of February 2021 to now (3/17) ```` -cust --id UNRATE -s 2021-02-01 +cust --id DEXUSEU -s 2021-02-01 ```` This will plot and display: +![cust](https://user-images.githubusercontent.com/18151143/111521481-92bcee00-872f-11eb-8a02-e7346e56e462.png) ```` DEXUSEU diff --git a/gamestonk_terminal/fred/fred_api.py b/gamestonk_terminal/fred/fred_api.py index 490c152c7f8..1b90ca10e87 100644 --- a/gamestonk_terminal/fred/fred_api.py +++ b/gamestonk_terminal/fred/fred_api.py @@ -17,23 +17,25 @@ register_matplotlib_converters() api_map = { "gdp": "GDP", "t10": "DGS10", - "t01": "DGS1", - "t05": "DGS5", + "t1": "DGS1", + "t5": "DGS5", "t30": "DGS30", "mort30": "MORTGAGE30US", - "libor3m": "USD3MTD156N", + "fedrate": "FEDFUNDS", "moodAAA": "AAA", + "usdcad": "DEXCAUS", "unemp": "UNRATE", } title_map = { - "gdp": "GDP", + "gdp": "Gross Domestic Product", "t10": "10-Year Treasury Constant Maturity Rate", - "t01": "1-Year Treasury Constant Maturity Rate", - "t05": "5-Year Treasury Constant Maturity Rate", + "t1": "1-Year Treasury Constant Maturity Rate", + "t5": "5-Year Treasury Constant Maturity Rate", "t30": "30-Year Treasury Constant Maturity Rate", - "mort30": "30-Year Treasury Constant Maturity Rate", - "libor3m": "3-Month LIBOR, based on U.S. Dollar", + "mort30": "30-Year Mortgage Rate", + "fedrate": "Effective Federal Funds Rate", "moodAAA": "Moody's Seasoned AAA Corporate Bond Yield", + "usdcad": "Canada / U.S. Foreign Exchange Rate", "unemp": "Unemployment Rate", } diff --git a/gamestonk_terminal/fred/fred_menu.py b/gamestonk_terminal/fred/fred_menu.py index 1c0137d740b..5a7734835be 100644 --- a/gamestonk_terminal/fred/fred_menu.py +++ b/gamestonk_terminal/fred/fred_menu.py @@ -1,4 +1,5 @@ import argparse +from matplotlib import pyplot as plt from prompt_toolkit.completion import NestedCompleter from gamestonk_terminal import feature_flags as gtff from gamestonk_terminal.helper_funcs import get_flair @@ -16,13 +17,14 @@ def print_fred(): print(" ") print(" gdp GDP") print(" unemp Unemployment Rate") - print(" t01 1-Year Treasury Constant Maturity Rate") - print(" t05 5-Year Treasury Constant Maturity Rate") + print(" t1 1-Year Treasury Constant Maturity Rate") + print(" t5 5-Year Treasury Constant Maturity Rate") print(" t10 10-Year Treasury Constant Maturity Rate") print(" t30 30-Year Treasury Constant Maturity Rate") print(" mort30 30-Year Fixed Rate Mortgage Average") - print(" libor3m 3-Month LIBOR, based on U.S. Dollar") + print(" fedrate Effective Federal Funds Rate") print(" moodAAA Moody's Seasoned AAA Corporate Bond Yield") + print(" usdcad Canada / U.S. Foreign Exchange Rate (CAD per 1 USD)") print("") print(" cust User Specified FRED Data - Please Specify --id") print("") @@ -30,17 +32,19 @@ def print_fred(): def fred_menu(): + plt.close("all") fred_parser = argparse.ArgumentParser(prog="fred", add_help=False) defined_choices = [ "gdp", "unemp", - "t01", - "t05", + "t1", + "t5", "t10", "t30", "mort30", - "libor3m", + "fedrate", "moodAAA", + "usdcad", ] choices = ["help", "q", "quit", "cust"] + defined_choices