From d2cfbdb27dec448bdab29fc6bde2f4c4e1835f9f Mon Sep 17 00:00:00 2001 From: didier Date: Wed, 26 May 2021 23:54:29 +0100 Subject: [PATCH 1/5] Fix FRED API KEY name #465 --- README.md | 14 +++++++------- gamestonk_terminal/econ/fred_view.py | 4 ++-- requirements-full.txt | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 4095623daa6..86112c3424a 100644 --- a/README.md +++ b/README.md @@ -87,9 +87,9 @@ As a modern Python-based environment, GamestonkTerminal opens access to numerous ## Donation -GST is a completely free open-source terminal. My personal goal has always been to keep this terminal available for everyone to use at zero cost. +GST is a completely free open-source terminal. My personal goal has always been to keep this terminal available for everyone to use at zero cost. -Lately, some developers have been helping me in this endeavour. As you can probably tell from the git history, the terminal has been increasing in features/robustness at a really fast pace. Since none of us are getting paid to do so, and we all have 9-5 jobs, it's hard to onbard people to work towards the cause. On a personal level, I stopped investing since the repository was made public, since I spend all my spare time working on it, and don't have time left for DD. +Lately, some developers have been helping me in this endeavour. As you can probably tell from the git history, the terminal has been increasing in features/robustness at a really fast pace. Since none of us are getting paid to do so, and we all have 9-5 jobs, it's hard to onbard people to work towards the cause. On a personal level, I stopped investing since the repository was made public, since I spend all my spare time working on it, and don't have time left for DD. There are many ways to help support GST. If technical development or support are one of your strengths, join our [discord](https://discord.gg/Up2QGbMKHY). Otherwise, you could certainly help us by providing a donation to our coinbase crypto wallet: **3Pfx7NwGgmZsk7hQJxzHdp5rGBftUHVTiM**. @@ -253,10 +253,10 @@ Alternatively, you can also set them to the following environment variables: | [Alpha Vantage](https://www.alphavantage.co) | GT_API_KEY_ALPHAVANTAGE | | [Binance](https://binance.com) | GT_API_BINANCE_KEY
GT_API_BINANCE_SECRET | | [CoinMarketCap](https://coinmarketcap.com) | GT_CMC_API_KEY
GT_CMC_API_KEY | -| [DEGIRO](https://www.degiro.fr) | DG_USERNAME
DG_PASSWORD
DG_TOTP_SECRET | -| [FRED](https://fred.stlouisfed.org) | GT_FRED_API_KEY | +| [DEGIRO](https://www.degiro.fr) | GT_DG_USERNAME
GT_DG_PASSWORD
GT_DG_TOTP_SECRET | +| [FRED](https://fred.stlouisfed.org) | GT_API_FRED_KEY | | [Financial Modeling Prep](https://financialmodelingprep.com) | GT_API_KEY_FINANCIALMODELINGPREP | -| [Finhub](https://finnhub.io) | API_FINNHUB_KEY | +| [Finhub](https://finnhub.io) | GT_API_FINNHUB_KEY | | [News](https://newsapi.org) | GT_API_NEWS_TOKEN | | [Oanda](https://developer.oanda.com) | GT_OANDA_TOKEN
GT_OANDA_ACCOUNT | | [Polygon](https://polygon.io) | GT_API_POLYGON_KEY | @@ -376,9 +376,9 @@ Feel free to share loss porn, memes or any questions at: #### Shoutout to: * **alokan** : Responsible by developing `Forex` menu -* **pll_llq** and **hinxx** : Working towards a GUI using Qt. +* **pll_llq** and **hinxx** : Working towards a GUI using Qt. * Get in touch in our [#gui](https://discord.gg/gQ3VxXEj) discord channel. -* **1lluz10n**, **crspy**, and **martiaaz** : Working on our landing page https://gamestonkterminal.vercel.app. +* **1lluz10n**, **crspy**, and **martiaaz** : Working on our landing page https://gamestonkterminal.vercel.app. * Get in touch in our [#landing-page](https://discord.gg/wkyB4xcb) discord channel. * **Chavithra** and **Deel18** : for Degiro's integration. diff --git a/gamestonk_terminal/econ/fred_view.py b/gamestonk_terminal/econ/fred_view.py index 88ba23b42e8..bf524185023 100644 --- a/gamestonk_terminal/econ/fred_view.py +++ b/gamestonk_terminal/econ/fred_view.py @@ -13,7 +13,7 @@ from gamestonk_terminal.helper_funcs import ( plot_autoscale, ) from gamestonk_terminal.config_plot import PLOT_DPI -from gamestonk_terminal.config_terminal import API_FRED_KEY +from gamestonk_terminal import config_terminal as cfg from gamestonk_terminal import feature_flags as gtff register_matplotlib_converters() @@ -90,7 +90,7 @@ def display_fred(other_args: List[str], choice: str): if not ns_parser: return - fred = Fred(api_key=API_FRED_KEY) + fred = Fred(api_key=cfg.API_FRED_KEY) d_data = fred.get_series(ns_parser.series_id, ns_parser.start_date) df_fred = pd.DataFrame(d_data, columns=[f"{ns_parser.series_id}"]) diff --git a/requirements-full.txt b/requirements-full.txt index a07e6ed4d9d..eda6b5a48f5 100644 --- a/requirements-full.txt +++ b/requirements-full.txt @@ -29,7 +29,7 @@ colorama==0.4.4; (python_version >= "2.7" and python_full_version < "3.0.0") or convertdate==2.3.2; python_version >= "3.5" cryptography==3.4.7; python_version >= "3.6" cssselect==1.1.0; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" -cvxpy==1.1.13; python_full_version >= "3.6.1" and python_full_version < "4.0.0" and python_version >= "3.6" +cvxpy==1.1.12; python_full_version >= "3.6.1" and python_full_version < "4.0.0" and python_version >= "3.5" cycler==0.10.0; python_version >= "3.6" cython==0.29.17; python_version >= "3.6" and python_full_version < "3.0.0" and sys_platform == "darwin" or python_full_version >= "3.3.0" and python_version >= "3.6" and sys_platform == "darwin" dataclasses==0.8; python_version >= "3.6" and python_version < "3.7" and python_full_version >= "3.6.2" and (python_version >= "3.6" and python_full_version < "3.0.0" and python_version < "3.7" or python_full_version >= "3.2.0" and python_version >= "3.6" and python_version < "3.7") From b957e4e67843cd080ac37724663f12037846dfd3 Mon Sep 17 00:00:00 2001 From: didier Date: Thu, 27 May 2021 00:33:00 +0100 Subject: [PATCH 2/5] revert requirements-full commit --- requirements-full.txt | 47 ++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/requirements-full.txt b/requirements-full.txt index eda6b5a48f5..1bfb43b2eca 100644 --- a/requirements-full.txt +++ b/requirements-full.txt @@ -3,7 +3,7 @@ aiohttp==3.7.4.post0; python_version >= "3.6" alpaca-trade-api==1.2.1 alpha-vantage==2.3.1 ansiwrap==0.8.4; python_version >= "3.6" -appdirs==1.4.4; python_full_version >= "3.6.2" and python_version >= "3.6" +appdirs==1.4.4; python_version >= "3.6" appnope==0.1.2; platform_system == "Darwin" and python_version >= "3.6" and sys_platform == "darwin" argon2-cffi==20.1.0; python_version >= "3.6" astunparse==1.6.3 @@ -12,17 +12,16 @@ async-timeout==3.0.1; python_full_version >= "3.5.3" and python_version >= "3.6" attrs==21.2.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6" backcall==0.2.0; python_version >= "3.6" beautifulsoup4==4.9.3; python_version >= "3.5" -black==21.5b1; python_full_version >= "3.6.2" +black==21.5b1; python_version >= "3.6" bleach==3.3.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6" bpemb==0.3.3; python_version >= "3.6" bs4==0.0.1 bt==0.2.9; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.6.0") -cached-property==1.5.2; python_version < "3.8" and python_version >= "3.6" cachetools==4.2.2; python_version >= "3.5" and python_version < "4.0" and (python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0") certifi==2020.12.5; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" cffi==1.14.5; implementation_name == "pypy" and python_version >= "3.6" chardet==4.0.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6" -click==8.0.1; python_full_version >= "3.6.2" and python_version >= "3.6" +click==8.0.0; python_version >= "3.6" and python_full_version >= "3.6.0" cloudpickle==1.6.0; python_version >= "3.6" cmdstanpy==0.4.0 colorama==0.4.4; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.5.0") @@ -40,7 +39,7 @@ defusedxml==0.7.1; python_version >= "3.6" and python_full_version < "3.0.0" or degiro-connector==0.1.0; python_version >= "3.6" deprecated==1.2.12; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6" detecta==0.0.5; python_version >= "3.6" -ecos==2.0.7.post1; python_full_version >= "3.6.1" and python_full_version < "4.0.0" and python_version >= "3.6" +ecos==2.0.7.post1; python_full_version >= "3.6.1" and python_full_version < "4.0.0" and python_version >= "3.5" entrypoints==0.3; python_version >= "3.6" ephem==3.7.7.1; python_version >= "2.7" and python_version < "4" fbprophet==0.6 @@ -51,17 +50,17 @@ finvizfinance==0.9.8; python_version >= "3.5" flair==0.7; python_version >= "3.6" flatbuffers==1.12 fredapi==0.4.3 -ftfy==6.0.3; python_version >= "3.6" +ftfy==6.0.1; python_version >= "3.6" fundamentalanalysis==0.2.9 future==0.18.2; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.6" -gast==0.4.0; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" +gast==0.3.3; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" gdown==3.13.0; python_version >= "3.6" gensim==3.8.2; python_version >= "3.6" google-auth-oauthlib==0.4.4; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.2.0" and python_version >= "3.6" -google-auth==1.30.1; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.6" +google-auth==1.30.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.6" google-pasta==0.2.0 -grpcio==1.34.0 -h5py==3.1.0; python_version >= "3.6" +grpcio==1.34.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.2.0" and python_version >= "3.6" +h5py==3.1.0 hijri-converter==2.1.1; python_version >= "3.6" holidays==0.10.5.2 hyperopt==0.2.5; python_version >= "3.6" @@ -76,7 +75,7 @@ ipywidgets==7.6.3 iso8601==0.1.14 janome==0.4.1; python_version >= "3.6" jedi==0.18.0; python_version >= "3.6" -jinja2==3.0.1; python_version >= "3.6" +jinja2==3.0.0; python_version >= "3.6" joblib==1.0.1; python_version >= "3.6" and python_full_version >= "3.6.0" jsonschema==3.2.0; python_version >= "3.6" jupyter-client==6.2.0; python_full_version >= "3.6.1" and python_version >= "3.6" @@ -96,13 +95,13 @@ markdown==3.3.4; python_version >= "3.6" and python_full_version < "3.0.0" or py markupsafe==2.0.1; python_version >= "3.6" matplotlib==3.3.4; python_version >= "3.6" mistune==0.8.4; python_version >= "3.6" -more-itertools==8.8.0; python_version >= "3.5" +more-itertools==8.7.0; python_version >= "3.5" mpld3==0.3; python_version >= "3.6" mplfinance==0.12.7a17 msgpack==1.0.2 multidict==5.1.0; python_version >= "3.6" multitasking==0.0.9 -mypy-extensions==0.4.3; python_full_version >= "3.6.2" and python_version >= "3.6" +mypy-extensions==0.4.3; python_version >= "3.6" nbclient==0.5.3; python_full_version >= "3.6.1" and python_version >= "3.6" nbconvert==6.0.7; python_version >= "3.6" nbformat==5.1.3; python_full_version >= "3.6.1" and python_version >= "3.6" @@ -115,7 +114,7 @@ oauthlib==3.1.0; python_version >= "2.7" and python_full_version < "3.0.0" or py onetimepass==1.0.1; python_version >= "3.6" opt-einsum==3.3.0; python_version >= "3.5" orjson==3.5.2; python_version >= "3.6" -osqp==0.6.2.post0; python_full_version >= "3.6.1" and python_full_version < "4.0.0" and python_version >= "3.6" +osqp==0.6.2.post0; python_full_version >= "3.6.1" and python_full_version < "4.0.0" and python_version >= "3.5" overrides==3.1.0; python_full_version >= "3.6.1" and python_full_version < "4.0.0" and python_version >= "3.6" packaging==20.9; python_full_version >= "3.6.0" and python_version >= "3.6" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6") pandas-datareader==0.9.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.6" @@ -124,7 +123,7 @@ pandas==1.1.5; python_full_version >= "3.6.1" pandocfilters==1.4.3; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6" papermill==2.3.3; python_version >= "3.6" parso==0.8.2; python_version >= "3.6" -pathspec==0.8.1; python_full_version >= "3.6.2" and python_version >= "3.6" +pathspec==0.8.1; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6" patsy==0.5.1; python_version >= "3.6" pexpect==4.8.0; sys_platform != "win32" and python_version >= "3.6" pickleshare==0.7.5; python_version >= "3.6" @@ -136,7 +135,7 @@ prawcore==2.0.0; python_version >= "3.6" and python_version < "4.0" prettytable==2.1.0; python_version >= "3.6" prometheus-client==0.10.1; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6" prompt-toolkit==3.0.18; python_full_version >= "3.6.1" -protobuf==3.17.1; python_full_version >= "3.6.0" and python_version >= "3.6" and (python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.2.0") +protobuf==3.17.0; python_full_version >= "3.6.0" and python_version >= "3.6" and (python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.2.0") psaw==0.0.12; python_version >= "3" ptyprocess==0.7.0; os_name != "nt" and python_version >= "3.6" and sys_platform != "win32" py==1.10.0; python_version >= "3.6" and python_full_version < "3.0.0" and implementation_name == "pypy" or implementation_name == "pypy" and python_version >= "3.6" and python_full_version >= "3.4.0" @@ -162,12 +161,11 @@ python-dateutil==2.8.1; python_full_version >= "3.6.1" and python_version >= "3. python-dotenv==0.17.1; python_version >= "3" pytrends==4.7.3 pytz==2021.1; python_full_version >= "3.6.1" and python_version >= "3.5" and python_version < "4" -pyupgrade==2.18.2; python_full_version >= "3.6.1" pywin32==300; sys_platform == "win32" and python_version >= "3.6" -pywinpty==1.1.1; os_name == "nt" and python_version >= "3.6" +pywinpty==1.1.0; os_name == "nt" and python_version >= "3.6" pyyaml==5.4.1; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.6" pyzmq==22.0.3; python_full_version >= "3.6.1" and python_version >= "3.6" -qdldl==0.1.5.post0; python_full_version >= "3.6.1" and python_full_version < "4.0.0" and python_version >= "3.6" +qdldl==0.1.5.post0; python_full_version >= "3.6.1" and python_full_version < "4.0.0" and python_version >= "3.5" qtconsole==5.1.0; python_version >= "3.6" qtpy==1.9.0; python_version >= "3.6" quandl==3.6.1; python_version >= "3.5" @@ -182,7 +180,7 @@ sacremoses==0.0.45; python_full_version >= "3.6.0" and python_version >= "3.6" scikit-learn==0.24.2; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.6" scipy==1.5.4; python_version >= "3.6" screeninfo==0.6.7 -scs==2.1.3; python_full_version >= "3.6.1" and python_full_version < "4.0.0" and python_version >= "3.6" +scs==2.1.3; python_full_version >= "3.6.1" and python_full_version < "4.0.0" and python_version >= "3.5" seaborn==0.11.1; python_version >= "3.6" segtok==1.5.10; python_version >= "3.6" selenium==3.141.0 @@ -207,17 +205,16 @@ testpath==0.5.0; python_version >= "3.6" textwrap3==0.9.2; python_version >= "3.6" threadpoolctl==2.1.0; python_version >= "3.6" timeseries-cv==0.1.4; python_version >= "3.6" and python_version < "4.0" -tokenize-rt==4.1.0; python_full_version >= "3.6.1" tokenizers==0.9.3; python_full_version >= "3.6.0" and python_version >= "3.6" -toml==0.10.2; python_full_version >= "3.6.2" and python_version >= "3.6" +toml==0.10.2; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.3.0" and python_version >= "3.6" torch==1.7.1; python_full_version >= "3.6.2" tornado==6.1; python_full_version >= "3.6.1" and python_version >= "3.6" -tqdm==4.61.0; python_full_version >= "3.6.0" and python_version >= "3.6" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6") +tqdm==4.60.0; python_full_version >= "3.6.0" and python_version >= "3.6" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6") tradingview-ta==3.2.3; python_version >= "3.5" traitlets==4.3.3; python_full_version >= "3.6.1" and python_version >= "3.6" transformers==3.5.1; python_full_version >= "3.6.0" -typed-ast==1.4.3; python_version < "3.8" and python_full_version >= "3.6.2" and python_version >= "3.6" -typing-extensions==3.7.4.3; python_version < "3.8" and python_full_version >= "3.6.2" and python_version >= "3.6" +typed-ast==1.4.3; python_version >= "3.6" +typing-extensions==3.7.4.3; python_full_version >= "3.6.2" and python_version >= "3.6" and python_version < "3.8" tzlocal==2.1; python_version >= "3.5" ujson==4.0.2; python_version >= "3.6" update-checker==0.18.0; python_version >= "3.6" and python_version < "4.0" From 92e641bf0ef5c6c926d43a6c063004ec72660ed4 Mon Sep 17 00:00:00 2001 From: Jamie Perkins Date: Wed, 26 May 2021 22:29:56 -0400 Subject: [PATCH 3/5] fix etf overview not parsing lowercase symbols --- gamestonk_terminal/etf/stockanalysis_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gamestonk_terminal/etf/stockanalysis_model.py b/gamestonk_terminal/etf/stockanalysis_model.py index 9fbaead7849..255a231c3ef 100644 --- a/gamestonk_terminal/etf/stockanalysis_model.py +++ b/gamestonk_terminal/etf/stockanalysis_model.py @@ -100,7 +100,7 @@ def etf_overview(other_args: List[str]): if not ns_parser: return "" - if ns_parser.name not in etf_symbols: + if ns_parser.name.upper() not in etf_symbols: print("ETF symbol not available") return "" r1 = requests.get(f"https://stockanalysis.com/etf/{ns_parser.name}") From af6e5723bf39a5091a9b8c1c23718ca6d72f8ca2 Mon Sep 17 00:00:00 2001 From: Jamie Perkins Date: Wed, 26 May 2021 22:34:51 -0400 Subject: [PATCH 4/5] web command supports etf symbol --- gamestonk_terminal/etf/etf_controller.py | 4 +- gamestonk_terminal/etf/stockanalysis_model.py | 41 +++++++++++++++++-- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/gamestonk_terminal/etf/etf_controller.py b/gamestonk_terminal/etf/etf_controller.py index 33457dd9c66..f9c15d4e6b0 100644 --- a/gamestonk_terminal/etf/etf_controller.py +++ b/gamestonk_terminal/etf/etf_controller.py @@ -69,9 +69,9 @@ class ETFController: """Process Quit command - quit the program""" return True - def call_web(self, _): + def call_web(self, other_args: List[str]): """Process web command""" - open_web() + open_web(other_args) def call_search(self, other_args: List[str]): """Process search command""" diff --git a/gamestonk_terminal/etf/stockanalysis_model.py b/gamestonk_terminal/etf/stockanalysis_model.py index 255a231c3ef..bd703791831 100644 --- a/gamestonk_terminal/etf/stockanalysis_model.py +++ b/gamestonk_terminal/etf/stockanalysis_model.py @@ -29,9 +29,44 @@ def limit_number_of_holdings(num: str) -> int: return int(num) -def open_web(): - """Opens webbrowser to the website page""" - webbrowser.open("https://stockanalysis.com/etf/") +def open_web(other_args: List[str]): + + """ + Opens webbrowser to the website page + Parameters + ---------- + other_args : List[str] + Argparse arguments + + """ + parser = argparse.ArgumentParser(prog="web", add_help=False) + parser.add_argument( + "-n", "--name", type=str, dest="name", help="Symbol to look for", required=False + ) + + try: + if other_args: + if "-" not in other_args[0]: + other_args.insert(0, "-n") + + ns_parser = parse_known_args_and_warn(parser, other_args) + + if not ns_parser: + return "" + + if not ns_parser.name: + webbrowser.open("https://stockanalysis.com/etf/") + return "" + + if ns_parser.name.upper() in etf_symbols: + webbrowser.open(f"https://stockanalysis.com/etf/{ns_parser.name.lower()}") + else: + print("ETF symbol not available") + return "" + + except Exception as e: + print(e, "\n") + return "" def name_search(other_args: List[str]): From b6479f63daf7a299eb59d3623bf70741fe73cef6 Mon Sep 17 00:00:00 2001 From: DidierRLopes Date: Thu, 27 May 2021 19:33:38 +0100 Subject: [PATCH 5/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 86112c3424a..92b2ebcc070 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ Sharing the terminal with friends and family would also go a long way. Thanks in ## Getting Started ### Install -If you'd like to see a video recording of the installation process, @JohnnyDankseed has made one available [here](https://www.twitch.tv/videos/1013768299). +If you'd like to see a video recording of the installation process, @JohnnyDankseed has made one available [here](https://www.youtube.com/watch?v=fYKw_MH6gi0). This project was originally written and tested with Python 3.6.8. It should now support Python 3.6, 3.7, and 3.8.