change options + README

This commit is contained in:
Jamie
2021-03-17 14:50:05 -04:00
parent 1d4ca80651
commit 6974567260
3 changed files with 27 additions and 16 deletions

View File

@@ -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 <a name="predefined"></a>
```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

View File

@@ -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",
}

View File

@@ -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