Improve menu UX (#532)

* Improve bt menu

* minor typo

* improve ba menu

* improve brokers menu

* improve CA menu

* improve crypto menu

* improve disc menu

* improve dd menu

* improve econ menu

* improve etf menu

* improve EDA menu

* improve fx menu

* improve FA menu

* improve gov menu

* improve op menu

* improve mill menu

* improve pa menu

* improve pred menu

* improve res menu

* improve ra menu

* improve rc menu

* improve scr menu

* improve po menu

* improve ta menu

* improve main terminal menu
This commit is contained in:
DidierRLopes
2021-07-05 09:17:24 +01:00
committed by GitHub
parent e76edc161f
commit b3d9ef479c
30 changed files with 660 additions and 55 deletions

View File

@@ -2,6 +2,7 @@
__docformat__ = "numpy"
import argparse
import os
from typing import List, Union
from datetime import datetime
import matplotlib as mpl
@@ -25,7 +26,7 @@ mpl.use(default_backend)
class BacktestingController:
"""Backtesting Class"""
CHOICES = ["help", "q", "quit", "ema", "ema_cross", "rsi"]
CHOICES = ["?", "cls", "help", "q", "quit", "ema", "ema_cross", "rsi"]
def __init__(
self,
@@ -46,7 +47,8 @@ class BacktestingController:
"https://github.com/GamestonkTerminal/GamestonkTerminal/tree/main/gamestonk_terminal/backtesting"
)
print("\nBacktesting:")
print(" help show this backtesting menu again")
print(" cls clear screen")
print(" ?/help show this menu again")
print(" q quit this menu, and shows back to main menu")
print(" quit quit to abandon program")
print("")
@@ -66,8 +68,23 @@ class BacktestingController:
None - continue in the menu
"""
# Empty command
if not an_input:
print("")
return None
(known_args, other_args) = self.bt_parser.parse_known_args(an_input.split())
# Help menu again
if known_args.cmd == "?":
self.print_help()
return None
# Clear screen
if known_args.cmd == "cls":
os.system("cls||clear")
return None
return getattr(
self, "call_" + known_args.cmd, lambda: "Command not recognized!"
)(other_args)
@@ -118,6 +135,7 @@ def menu(ticker: str, start: Union[str, datetime]):
try:
plt.close("all")
process_input = bt_controller.switch(an_input)
if process_input is not None:
return process_input

View File

@@ -2,6 +2,7 @@
__docformat__ = "numpy"
import argparse
import os
from typing import List
from datetime import datetime
from prompt_toolkit.completion import NestedCompleter
@@ -23,6 +24,8 @@ class BehaviouralAnalysisController:
# Command choices
CHOICES = [
"?",
"cls",
"help",
"q",
"quit",
@@ -62,7 +65,8 @@ class BehaviouralAnalysisController:
"https://github.com/GamestonkTerminal/GamestonkTerminal/tree/main/gamestonk_terminal/behavioural_analysis"
)
print("\nBehavioural Analysis:")
print(" help show this behavioural analysis menu again")
print(" cls clear screen")
print(" ?/help show this menu again")
print(" q quit this menu, and shows back to main menu")
print(" quit quit to abandon program")
print("")
@@ -109,8 +113,23 @@ class BehaviouralAnalysisController:
True - quit the program
None - continue in the menu
"""
# Empty command
if not an_input:
print("")
return None
(known_args, other_args) = self.ba_parser.parse_known_args(an_input.split())
# Help menu again
if known_args.cmd == "?":
self.print_help()
return None
# Clear screen
if known_args.cmd == "cls":
os.system("cls||clear")
return None
return getattr(
self, "call_" + known_args.cmd, lambda: "Command not recognized!"
)(other_args)

View File

@@ -3,6 +3,7 @@ __docformat__ = "numpy"
# pylint: disable=R1710
import argparse
import os
from typing import List
import pandas as pd
from prompt_toolkit.completion import NestedCompleter
@@ -26,6 +27,8 @@ class BrokersController:
"""Brokers Controller"""
CHOICES = [
"?",
"cls",
"alphist",
"alphold",
"allyhold",
@@ -56,13 +59,16 @@ class BrokersController:
print(
"https://github.com/GamestonkTerminal/GamestonkTerminal/tree/main/gamestonk_terminal/brokers"
)
print()
print(" ?/help show this menu again")
print(
"\nBrokers Supported:\n"
" ally - Ally Invest\n"
" alp - Alpaca\n"
" rh - Robinhood\n"
"\nPortfolio:\n"
" help show this menu again\n"
" cls clear screen\n"
" ?/help show this menu again\n"
" q quit this menu, and shows back to main menu, logs out of brokers\n"
" quit quit to abandon program, logs out of brokers\n"
)
@@ -97,8 +103,23 @@ class BrokersController:
None - continue in the menu
"""
# Empty command
if not an_input:
print("")
return None
(known_args, other_args) = self.bro_parser.parse_known_args(an_input.split())
# Help menu again
if known_args.cmd == "?":
self.print_help()
return None
# Clear screen
if known_args.cmd == "cls":
os.system("cls||clear")
return None
return getattr(
self, "call_" + known_args.cmd, lambda: "Command not recognized!"
)(other_args)

View File

@@ -1,5 +1,6 @@
# IMPORTATION STANDARD
import argparse
import os
# IMPORTATION THIRDPARTY
from prompt_toolkit.completion import NestedCompleter
@@ -18,6 +19,8 @@ from gamestonk_terminal.brokers.degiro.degiro_view import DegiroView
class DegiroController:
CHOICES = [
"?",
"cls",
"cancel",
"companynews",
"create",
@@ -343,8 +346,23 @@ class DegiroController:
try:
degiro_parser = self.__degiro_parser
# Empty command
if not an_input:
print("")
return None
(known_args, other_args) = degiro_parser.parse_known_args(an_input.split())
# Help menu again
if known_args.cmd == "?":
DegiroView.help_display()
return None
# Clear screen
if known_args.cmd == "cls":
os.system("cls||clear")
return None
return getattr(
self,
known_args.cmd,

View File

@@ -2,6 +2,7 @@
__docformat__ = "numpy"
import argparse
import os
import random
from typing import List
from datetime import datetime
@@ -27,6 +28,8 @@ class ComparisonAnalysisController:
# Command choices
CHOICES = [
"?",
"cls",
"help",
"q",
"quit",
@@ -101,7 +104,8 @@ class ComparisonAnalysisController:
print(f"[{self.user}] Similar Companies: {', '.join(self.similar)}")
print("\nComparison Analysis Mode:")
print(" help show this comparison analysis menu again")
print(" cls clear screen")
print(" ?/help show this menu again")
print(" q quit this menu, and shows back to main menu")
print(" quit quit to abandon program")
print("")
@@ -281,8 +285,24 @@ class ComparisonAnalysisController:
True - quit the program
None - continue in the menu
"""
# Empty command
if not an_input:
print("")
return None
(known_args, other_args) = self.ca_parser.parse_known_args(an_input.split())
# Help menu again
if known_args.cmd == "?":
self.print_help()
return None
# Clear screen
if known_args.cmd == "cls":
os.system("cls||clear")
return None
return getattr(
self, "call_" + known_args.cmd, lambda: "Command not recognized!"
)(other_args)

View File

@@ -2,6 +2,7 @@
__docformat__ = "numpy"
# pylint: disable=R0904, C0302, W0622
import argparse
import os
import pandas as pd
from prompt_toolkit.completion import NestedCompleter
from gamestonk_terminal import feature_flags as gtff
@@ -13,7 +14,19 @@ from gamestonk_terminal.technical_analysis import ta_controller
class BinanceController:
CHOICES = ["help", "q", "quit", "book", "candle", "balance", "load", "ta", "clear"]
CHOICES = [
"?",
"cls",
"help",
"q",
"quit",
"book",
"candle",
"balance",
"load",
"ta",
"clear",
]
def __init__(self):
"""CONSTRUCTOR"""
@@ -28,7 +41,8 @@ class BinanceController:
def print_help(self):
"""Print help"""
print("\nBinance:")
print(" help show this menu again")
print(" cls clear screen")
print(" ?/help show this menu again")
print(" q quit this menu, and shows back to main menu")
print(" quit quit to abandon program")
print("")
@@ -52,10 +66,26 @@ class BinanceController:
True - quit the program
None - continue in the menu
"""
# Empty command
if not an_input:
print("")
return None
(known_args, other_args) = self._binance_parser.parse_known_args(
an_input.split()
)
# Help menu again
if known_args.cmd == "?":
self.print_help()
return None
# Clear screen
if known_args.cmd == "cls":
os.system("cls||clear")
return None
return getattr(
self, "call_" + known_args.cmd, lambda: "Command not recognized!"
)(other_args)

View File

@@ -2,6 +2,7 @@
__docformat__ = "numpy"
# pylint: disable=R0904, C0302, W0622
import argparse
import os
import pandas as pd
from prompt_toolkit.completion import NestedCompleter
from gamestonk_terminal import feature_flags as gtff
@@ -14,6 +15,8 @@ from gamestonk_terminal.technical_analysis import ta_controller
class GeckoController:
CHOICES = [
"?",
"cls",
"help",
"q",
"quit",
@@ -74,7 +77,8 @@ class GeckoController:
def print_help(self):
"""Print help"""
print("\nCoinGecko:")
print(" help show this menu again")
print(" cls clear screen")
print(" ?/help show this menu again")
print(" q quit this menu, and shows back to main menu")
print(" quit quit to abandon program")
print("")
@@ -145,8 +149,24 @@ class GeckoController:
True - quit the program
None - continue in the menu
"""
# Empty command
if not an_input:
print("")
return None
(known_args, other_args) = self._gecko_parser.parse_known_args(an_input.split())
# Help menu again
if known_args.cmd == "?":
self.print_help()
return None
# Clear screen
if known_args.cmd == "cls":
os.system("cls||clear")
return None
return getattr(
self, "call_" + known_args.cmd, lambda: "Command not recognized!"
)(other_args)

View File

@@ -2,6 +2,7 @@
__docformat__ = "numpy"
# pylint: disable=R0904, C0302, W0622
import argparse
import os
import pandas as pd
from prompt_toolkit.completion import NestedCompleter
from gamestonk_terminal import feature_flags as gtff
@@ -15,6 +16,8 @@ from gamestonk_terminal.cryptocurrency.coinmarketcap import (
class CMCController:
CHOICES = [
"?",
"cls",
"help",
"q",
"quit",
@@ -34,7 +37,8 @@ class CMCController:
def print_help(self):
"""Print help"""
print("\nCoinmarketcap:")
print(" help show this menu again")
print(" cls clear screen")
print(" ?/help show this menu again")
print(" q quit this menu, and shows back to main menu")
print(" quit quit to abandon program")
print(" top view top coins from coinmarketcap")
@@ -50,8 +54,24 @@ class CMCController:
True - quit the program
None - continue in the menu
"""
# Empty command
if not an_input:
print("")
return None
(known_args, other_args) = self._cmc_parser.parse_known_args(an_input.split())
# Help menu again
if known_args.cmd == "?":
self.print_help()
return None
# Clear screen
if known_args.cmd == "cls":
os.system("cls||clear")
return None
return getattr(
self, "call_" + known_args.cmd, lambda: "Command not recognized!"
)(other_args)

View File

@@ -2,6 +2,7 @@
__docformat__ = "numpy"
# pylint: disable=R0904, C0302, R1710
import argparse
import os
import matplotlib.pyplot as plt
from prompt_toolkit.completion import NestedCompleter
from gamestonk_terminal import feature_flags as gtff
@@ -15,6 +16,8 @@ from gamestonk_terminal.cryptocurrency.coingecko import pycoingecko_controller
class CryptoController:
CHOICES = [
"?",
"cls",
"help",
"q",
"quit",
@@ -35,7 +38,8 @@ class CryptoController:
"https://github.com/GamestonkTerminal/GamestonkTerminal/tree/main/gamestonk_terminal/cryptocurrency"
)
print("\nCryptocurrency:")
print(" help show this menu again")
print(" cls clear screen")
print(" ?/help show this menu again")
print(" q quit this menu, and shows back to main menu")
print(" quit quit to abandon program")
print("")
@@ -54,8 +58,24 @@ class CryptoController:
True - quit the program
None - continue in the menu
"""
# Empty command
if not an_input:
print("")
return None
(known_args, other_args) = self.crypto_parser.parse_known_args(an_input.split())
# Help menu again
if known_args.cmd == "?":
self.print_help()
return None
# Clear screen
if known_args.cmd == "cls":
os.system("cls||clear")
return None
return getattr(
self, "call_" + known_args.cmd, lambda: "Command not recognized!"
)(other_args)

View File

@@ -32,6 +32,8 @@ class DiscoveryController:
# Command choices
CHOICES = [
"?",
"cls",
"help",
"q",
"quit",
@@ -75,7 +77,8 @@ class DiscoveryController:
"https://github.com/GamestonkTerminal/GamestonkTerminal/tree/main/gamestonk_terminal/discovery"
)
print("\nDiscovery Mode:")
print(" help show this discovery menu again")
print(" cls clear screen")
print(" ?/help show this discovery menu again")
print(" q quit this menu, and shows back to main menu")
print(" quit quit to abandon program")
print("")
@@ -121,6 +124,11 @@ class DiscoveryController:
True - quit the program
None - continue in the menu
"""
# Empty command
if not an_input:
print("")
return None
(known_args, other_args) = self.disc_parser.parse_known_args(an_input.split())
# Due to Finviz implementation of Spectrum, we delete the generated spectrum figure
@@ -131,6 +139,16 @@ class DiscoveryController:
os.remove(self.spectrum_img_to_delete + ".jpg")
self.spectrum_img_to_delete = ""
# Help menu again
if known_args.cmd == "?":
self.print_help()
return None
# Clear screen
if known_args.cmd == "cls":
os.system("cls||clear")
return None
return getattr(
self, "call_" + known_args.cmd, lambda: "Command not recognized!"
)(other_args)

View File

@@ -2,6 +2,7 @@
__docformat__ = "numpy"
import argparse
import os
from typing import List
from pandas.core.frame import DataFrame
from prompt_toolkit.completion import NestedCompleter
@@ -27,6 +28,8 @@ class DueDiligenceController:
# Command choices
CHOICES = [
"?",
"cls",
"help",
"q",
"quit",
@@ -88,7 +91,8 @@ class DueDiligenceController:
print(f"\n{intraday} Stock: {self.ticker}")
print("\nDue Diligence:")
print(" help show this fundamental analysis menu again")
print(" cls clear screen")
print(" ?/help show this menu again")
print(" q quit this menu, and shows back to main menu")
print(" quit quit to abandon program")
print("")
@@ -128,8 +132,24 @@ class DueDiligenceController:
True - quit the program
None - continue in the menu
"""
# Empty command
if not an_input:
print("")
return None
(known_args, other_args) = self.dd_parser.parse_known_args(an_input.split())
# Help menu again
if known_args.cmd == "?":
self.print_help()
return None
# Clear screen
if known_args.cmd == "cls":
os.system("cls||clear")
return None
return getattr(
self, "call_" + known_args.cmd, lambda: "Command not recognized!"
)(other_args)

View File

@@ -2,6 +2,7 @@
__docformat__ = "numpy"
import argparse
import os
from typing import List
from prompt_toolkit.completion import NestedCompleter
from gamestonk_terminal import feature_flags as gtff
@@ -17,6 +18,8 @@ class EconomyController:
# Command choices
CHOICES = [
"?",
"cls",
"help",
"q",
"quit",
@@ -51,7 +54,8 @@ class EconomyController:
"https://github.com/GamestonkTerminal/GamestonkTerminal/tree/main/gamestonk_terminal/economy"
)
print("\nEconomic Data:")
print(" help show this menu again")
print(" cls clear screen")
print(" ?/help show this menu again")
print(" q quit this menu, and shows back to main menu")
print(" quit quit to abandon program")
print(" ")
@@ -84,8 +88,24 @@ class EconomyController:
True - quit the program
None - continue in the menu
"""
# Empty command
if not an_input:
print("")
return None
(known_args, other_args) = self.econ_parser.parse_known_args(an_input.split())
# Help menu again
if known_args.cmd == "?":
self.print_help()
return None
# Clear screen
if known_args.cmd == "cls":
os.system("cls||clear")
return None
return getattr(
self, "call_" + known_args.cmd, lambda: "Command not recognized!"
)(other_args)

View File

@@ -2,6 +2,7 @@
__docformat__ = "numpy"
import argparse
import os
from typing import List
import matplotlib.pyplot as plt
from prompt_toolkit.completion import NestedCompleter
@@ -18,7 +19,18 @@ from gamestonk_terminal.etf.stockanalysis_model import (
class ETFController:
CHOICES = ["help", "q", "quit", "web", "search", "overview", "compare", "holdings"]
CHOICES = [
"cls",
"?",
"help",
"q",
"quit",
"web",
"search",
"overview",
"compare",
"holdings",
]
def __init__(self):
"""CONSTRUCTOR"""
@@ -32,7 +44,8 @@ class ETFController:
"https://github.com/GamestonkTerminal/GamestonkTerminal/tree/main/gamestonk_terminal/etf"
)
print("\nETF:")
print(" help show this menu again")
print(" cls clear screen")
print(" ?/help show this menu again")
print(" q quit this menu, and shows back to main menu")
print(" quit quit to abandon program")
print("\nStockAnalysis.com")
@@ -54,8 +67,24 @@ class ETFController:
True - quit the program
None - continue in the menu
"""
# Empty command
if not an_input:
print("")
return None
(known_args, other_args) = self.etf_parser.parse_known_args(an_input.split())
# Help menu again
if known_args.cmd == "?":
self.print_help()
return None
# Clear screen
if known_args.cmd == "cls":
os.system("cls||clear")
return None
return getattr(
self, "call_" + known_args.cmd, lambda: "Command not recognized!"
)(other_args)

View File

@@ -2,6 +2,7 @@
__docformat__ = "numpy"
import argparse
import os
from typing import List
from datetime import datetime
import pandas as pd
@@ -18,6 +19,8 @@ class EdaController:
# Command choices
CHOICES = [
"?",
"cls",
"help",
"q",
"quit",
@@ -66,7 +69,8 @@ class EdaController:
print(f"\n{s_intraday} Stock: {self.ticker}")
print("\nExploratory Data Analysis:")
print(" help show this comparison analysis menu again")
print(" cls clear screen")
print(" ?/help show this menu again")
print(" q quit this menu, and shows back to main menu")
print(" quit quit to abandon program")
print("")
@@ -92,8 +96,24 @@ class EdaController:
True - quit the program
None - continue in the menu
"""
# Empty command
if not an_input:
print("")
return None
(known_args, other_args) = self.stats_parser.parse_known_args(an_input.split())
# Help menu again
if known_args.cmd == "?":
self.print_help()
return None
# Clear screen
if known_args.cmd == "cls":
os.system("cls||clear")
return None
return getattr(
self, "call_" + known_args.cmd, lambda: "Command not recognized!"
)(other_args)

View File

@@ -1,4 +1,5 @@
import argparse
import os
from typing import List
import pandas as pd
from prompt_toolkit.completion import NestedCompleter
@@ -19,6 +20,8 @@ class ForexController:
"""Oanda Controller class"""
CHOICES = [
"cls",
"?",
"help",
"q",
"quit",
@@ -57,37 +60,38 @@ class ForexController:
"https://github.com/GamestonkTerminal/GamestonkTerminal/tree/main/gamestonk_terminal/forex"
)
print("\nForex Mode:")
print(" help show this menu again")
print(" q quit this menu and goes back to main menu")
print(" quit quit to abandon program")
print(" cls clear screen")
print(" ?/help show this menu again")
print(" q quit this menu and goes back to main menu")
print(" quit quit to abandon program")
print("")
print(" summary shows account summary")
print(" calendar show calendar")
print(" list list order history")
print(" pending get information on pending orders")
print(" cancel cancel a pending order by ID -i order ID")
print(" positions get open positions")
print(" trades list open trades")
print(" closetrade close a trade by id")
print(" summary shows account summary")
print(" calendar show calendar")
print(" list list order history")
print(" pending get information on pending orders")
print(" cancel cancel a pending order by ID -i order ID")
print(" positions get open positions")
print(" trades list open trades")
print(" closetrade close a trade by id")
print("")
print(f"Loaded instrument: {self.instrument if self.instrument else ''}")
print("")
print(" load load an instrument to use")
if self.instrument:
print(" candles show candles")
print(" price shows price for selected instrument")
print(" order place limit order -u # of units -p price")
print(" orderbook print orderbook")
print(" positionbook print positionbook")
print(" news print news [News API]")
print(" candles show candles")
print(" price shows price for selected instrument")
print(" order place limit order -u # of units -p price")
print(" orderbook print orderbook")
print(" positionbook print positionbook")
print(" news print news [News API]")
print(
" reddit search reddit for posts about the loaded instrument"
" reddit search reddit for posts about the loaded instrument"
)
print(
" > eda exploratory data analysis, e.g.: decompose, cusum, residuals analysis"
"> eda exploratory data analysis, e.g.: decompose, cusum, residuals analysis"
)
print(
" > ba behavioural analysis, from: reddit, stocktwits, twitter, google"
"> ba behavioural analysis, from: reddit, stocktwits, twitter, google"
)
print("")
@@ -101,8 +105,24 @@ class ForexController:
True - quit the program
None - continue in the menu
"""
# Empty command
if not an_input:
print("")
return None
(known_args, other_args) = self.fx_parser.parse_known_args(an_input.split())
# Help menu again
if known_args.cmd == "?":
self.print_help()
return None
# Clear screen
if known_args.cmd == "cls":
os.system("cls||clear")
return None
return getattr(
self, "call_" + known_args.cmd, lambda: "command not recognized!"
)(other_args)

View File

@@ -2,6 +2,7 @@
__docformat__ = "numpy"
import argparse
import os
from typing import List
from prompt_toolkit.completion import NestedCompleter
@@ -16,6 +17,8 @@ class AlphaVantageController:
# Command choices
CHOICES = [
"cls",
"?",
"help",
"q",
"quit",
@@ -65,6 +68,8 @@ class AlphaVantageController:
print(f"\n{intraday} Stock: {self.ticker}")
print("\nAlpha Vantage:")
print(" cls clear screen")
print(" ?/help show this menu again")
print(" help show this alpha vantage menu again")
print(" q quit this menu, and shows back to main menu")
print(" quit quit to abandon program")
@@ -87,8 +92,24 @@ class AlphaVantageController:
True - quit the program
None - continue in the menu
"""
# Empty command
if not an_input:
print("")
return None
(known_args, other_args) = self.av_parser.parse_known_args(an_input.split())
# Help menu again
if known_args.cmd == "?":
self.print_help()
return None
# Clear screen
if known_args.cmd == "cls":
os.system("cls||clear")
return None
return getattr(
self, "call_" + known_args.cmd, lambda: "Command not recognized!"
)(other_args)

View File

@@ -2,6 +2,7 @@
__docformat__ = "numpy"
import argparse
import os
from typing import List
from prompt_toolkit.completion import NestedCompleter
@@ -26,6 +27,8 @@ class FundamentalAnalysisController:
# Command choices
CHOICES = [
"cls",
"?",
"help",
"q",
"quit",
@@ -80,10 +83,9 @@ class FundamentalAnalysisController:
else:
print(f"\n{intraday} Stock: {self.ticker}")
print(
"\nFundamental Analysis:"
) # https://github.com/JerBouma/FundamentalAnalysis
print(" help show this fundamental analysis menu again")
print("\nFundamental Analysis:")
print(" cls clear screen")
print(" ?/help show this menu again")
print(" q quit this menu, and shows back to main menu")
print(" quit quit to abandon program")
print("")
@@ -120,8 +122,23 @@ class FundamentalAnalysisController:
None - continue in the menu
"""
# Empty command
if not an_input:
print("")
return None
(known_args, other_args) = self.fa_parser.parse_known_args(an_input.split())
# Help menu again
if known_args.cmd == "?":
self.print_help()
return None
# Clear screen
if known_args.cmd == "cls":
os.system("cls||clear")
return None
return getattr(
self, "call_" + known_args.cmd, lambda: "Command not recognized!"
)(other_args)

View File

@@ -2,6 +2,7 @@
__docformat__ = "numpy"
import argparse
import os
from typing import List
from prompt_toolkit.completion import NestedCompleter
@@ -18,6 +19,8 @@ class FinancialModelingPrepController:
# Command choices
CHOICES = [
"cls",
"?",
"help",
"q",
"quit",
@@ -71,7 +74,8 @@ class FinancialModelingPrepController:
print(f"\n{intraday} Stock: {self.ticker}")
print("\nFinancial Modeling Prep API")
print(" help show this financial modeling prep menu again")
print(" cls clear screen")
print(" ?/help show this menu again")
print(" q quit this menu, and shows back to main menu")
print(" quit quit to abandon program")
print("")
@@ -97,8 +101,24 @@ class FinancialModelingPrepController:
True - quit the program
None - continue in the menu
"""
# Empty command
if not an_input:
print("")
return None
(known_args, other_args) = self.fmp_parser.parse_known_args(an_input.split())
# Help menu again
if known_args.cmd == "?":
self.print_help()
return None
# Clear screen
if known_args.cmd == "cls":
os.system("cls||clear")
return None
return getattr(
self, "call_" + known_args.cmd, lambda: "Command not recognized!"
)(other_args)

View File

@@ -2,6 +2,7 @@
__docformat__ = "numpy"
import argparse
import os
from typing import List
from matplotlib import pyplot as plt
from prompt_toolkit.completion import NestedCompleter
@@ -16,6 +17,8 @@ class GovController:
# Command choices
CHOICES = [
"cls",
"?",
"help",
"q",
"quit",
@@ -62,7 +65,8 @@ class GovController:
"https://github.com/GamestonkTerminal/GamestonkTerminal/tree/main/gamestonk_terminal/government"
)
print("\nExploratory Data Analysis:")
print(" help show this comparison analysis menu again")
print(" cls clear screen")
print(" ?/help show this menu again")
print(" q quit this menu, and shows back to main menu")
print(" quit quit to abandon program")
print("")
@@ -106,8 +110,24 @@ class GovController:
True - quit the program
None - continue in the menu
"""
# Empty command
if not an_input:
print("")
return None
(known_args, other_args) = self.gov_parser.parse_known_args(an_input.split())
# Help menu again
if known_args.cmd == "?":
self.print_help()
return None
# Clear screen
if known_args.cmd == "cls":
os.system("cls||clear")
return None
return getattr(
self, "call_" + known_args.cmd, lambda: "Command not recognized!"
)(other_args)

View File

@@ -2,6 +2,7 @@
__docformat__ = "numpy"
import argparse
import os
from typing import List
import matplotlib.pyplot as plt
import pandas as pd
@@ -24,6 +25,8 @@ class OptionsController:
# Command choices
CHOICES = [
"cls",
"?",
"help",
"q",
"quit",
@@ -114,7 +117,8 @@ class OptionsController:
"https://github.com/GamestonkTerminal/GamestonkTerminal/tree/main/gamestonk_terminal/options"
)
print("\nOptions:")
print(" help show this menu again")
print(" cls clear screen")
print(" ?/help show this menu again")
print(" q quit this menu, and shows back to main menu")
print(" quit quit to abandon program")
print("")
@@ -145,8 +149,24 @@ class OptionsController:
True - quit the program
None - continue in the menu
"""
# Empty command
if not an_input:
print("")
return None
(known_args, other_args) = self.op_parser.parse_known_args(an_input.split())
# Help menu again
if known_args.cmd == "?":
self.print_help(self.expiry_date)
return None
# Clear screen
if known_args.cmd == "cls":
os.system("cls||clear")
return None
return getattr(
self, "call_" + known_args.cmd, lambda: "Command not recognized!"
)(other_args)

View File

@@ -2,6 +2,7 @@
__docformat__ = "numpy"
import argparse
import os
from typing import List
from gamestonk_terminal.papermill import due_diligence_view
@@ -20,7 +21,7 @@ class PapermillController:
)
self.papermill_parser.add_argument(
"cmd",
choices=["help", "q", "quit", "dd", "econ"],
choices=["cls", "?", "help", "q", "quit", "dd", "econ"],
)
def switch(self, an_input: str):
@@ -33,10 +34,26 @@ class PapermillController:
True - quit the program
None - continue in the menu
"""
# Empty command
if not an_input:
print("")
return None
(known_args, other_args) = self.papermill_parser.parse_known_args(
an_input.split()
)
# Help menu again
if known_args.cmd == "?":
print_papermill()
return None
# Clear screen
if known_args.cmd == "cls":
os.system("cls||clear")
return None
return getattr(
self, "call_" + known_args.cmd, lambda: "Command not recognized!"
)(other_args)
@@ -68,7 +85,8 @@ def print_papermill():
"https://github.com/GamestonkTerminal/GamestonkTerminal/tree/main/gamestonk_terminal/papermill"
)
print("\nPapermill Reports:")
print(" help show this papermill menu again")
print(" cls clear screen")
print(" ?/help show this menu again")
print(" q quit this menu, and shows back to main menu")
print(" quit quit to abandon program")
print("")

View File

@@ -1,6 +1,7 @@
__docformat__ = "numpy"
import argparse
import os
import pandas as pd
from prompt_toolkit.completion import NestedCompleter
@@ -15,6 +16,8 @@ class PortfolioController:
"""Portfolio Controller"""
CHOICES = [
"cls",
"?",
"help",
"q",
"quit",
@@ -34,7 +37,8 @@ class PortfolioController:
"https://github.com/GamestonkTerminal/GamestonkTerminal/tree/main/gamestonk_terminal/portfolio_analysis"
)
print("\nPortfolio Analysis:")
print(" help show this menu again")
print(" cls clear screen")
print(" ?/help show this menu again")
print(" q quit this menu, and shows back to main menu")
print(" quit quit to abandon program")
print("")
@@ -57,8 +61,23 @@ class PortfolioController:
None - continue in the menu
"""
# Empty command
if not an_input:
print("")
return None
(known_args, other_args) = self.pa_parser.parse_known_args(an_input.split())
# Help menu again
if known_args.cmd == "?":
self.print_help()
return None
# Clear screen
if known_args.cmd == "cls":
os.system("cls||clear")
return None
return getattr(
self, "call_" + known_args.cmd, lambda: "Command not recognized!"
)(other_args)

View File

@@ -2,6 +2,7 @@
__docformat__ = "numpy"
import argparse
import os
from typing import List
import matplotlib.pyplot as plt
from prompt_toolkit.completion import NestedCompleter
@@ -14,6 +15,8 @@ from gamestonk_terminal.portfolio_optimization import optimizer_view
class PortfolioOptimization:
CHOICES = [
"cls",
"?",
"help",
"q",
"quit",
@@ -53,7 +56,8 @@ class PortfolioOptimization:
"https://github.com/GamestonkTerminal/GamestonkTerminal/tree/main/gamestonk_terminal/portfolio_optimization"
)
print("\nPortfolio Optimization:")
print(" help show this menu again")
print(" cls clear screen")
print(" ?/help show this menu again")
print(" q quit this menu, and shows back to main menu")
print(" quit quit to abandon program")
print(f"\nCurrent Tickers: {('None', ', '.join(tickers))[bool(tickers)]}")
@@ -96,8 +100,24 @@ class PortfolioOptimization:
True - quit the program
None - continue in the menu
"""
# Empty command
if not an_input:
print("")
return None
(known_args, other_args) = self.po_parser.parse_known_args(an_input.split())
# Help menu again
if known_args.cmd == "?":
self.print_help(self.tickers)
return None
# Clear screen
if known_args.cmd == "cls":
os.system("cls||clear")
return None
return getattr(
self, "call_" + known_args.cmd, lambda: "Command not recognized!"
)(other_args)

View File

@@ -2,6 +2,7 @@
__docformat__ = "numpy"
import argparse
import os
from typing import List
from datetime import datetime
import pandas as pd
@@ -25,6 +26,8 @@ class PredictionTechniquesController:
# Command choices
CHOICES = [
"cls",
"?",
"help",
"q",
"quit",
@@ -74,7 +77,8 @@ class PredictionTechniquesController:
print(f"\n{s_intraday} Stock: {self.ticker}")
print("\nPrediction Techniques:")
print(" help show this prediction techniques menu again")
print(" cls clear screen")
print(" ?/help show this menu again")
print(" q quit this menu, and shows back to main menu")
print(" quit quit to abandon program")
print("")
@@ -101,8 +105,24 @@ class PredictionTechniquesController:
True - quit the program
None - continue in the menu
"""
# Empty command
if not an_input:
print("")
return None
(known_args, other_args) = self.pred_parser.parse_known_args(an_input.split())
# Help menu again
if known_args.cmd == "?":
self.print_help()
return None
# Clear screen
if known_args.cmd == "cls":
os.system("cls||clear")
return None
return getattr(
self, "call_" + known_args.cmd, lambda: "Command not recognized!"
)(other_args)

View File

@@ -2,6 +2,7 @@
__docformat__ = "numpy"
import argparse
import os
import webbrowser
from datetime import datetime
from prompt_toolkit.completion import NestedCompleter
@@ -15,6 +16,8 @@ class ResearchController:
# Command choices
CHOICES = [
"cls",
"?",
"help",
"q",
"quit",
@@ -64,7 +67,8 @@ class ResearchController:
print(f"\n{s_intraday} Stock: {self.ticker}")
print("\nResearch:")
print(" help show this behavioural analysis menu again")
print(" cls clear screen")
print(" ?/help show this menu again")
print(" q quit this menu, and shows back to main menu")
print(" quit quit to abandon program")
print("")
@@ -97,8 +101,24 @@ class ResearchController:
True - quit the program
None - continue in the menu
"""
# Empty command
if not an_input:
print("")
return None
(known_args, other_args) = self.res_parser.parse_known_args(an_input.split())
# Help menu again
if known_args.cmd == "?":
self.print_help()
return None
# Clear screen
if known_args.cmd == "cls":
os.system("cls||clear")
return None
if other_args:
print(f"The following args were unexpected: {other_args}")

View File

@@ -2,6 +2,7 @@
__docformat__ = "numpy"
import argparse
import os
from typing import List
from datetime import datetime
import pandas as pd
@@ -19,6 +20,8 @@ class ResidualsController:
# Command choices
CHOICES = [
"cls",
"?",
"help",
"q",
"quit",
@@ -75,7 +78,8 @@ class ResidualsController:
print(f"\nModel fit: {self.model_name}")
print("\nResiduals Analysis:")
print(" help show this comparison analysis menu again")
print(" cls clear screen")
print(" ?/help show this menu again")
print(" q quit this menu, and shows back to main menu")
print(" quit quit to abandon program")
print(" pick pick one of the model fitting.")
@@ -163,8 +167,24 @@ class ResidualsController:
True - quit the program
None - continue in the menu
"""
# Empty command
if not an_input:
print("")
return None
(known_args, other_args) = self.ra_parser.parse_known_args(an_input.split())
# Help menu again
if known_args.cmd == "?":
self.print_help()
return None
# Clear screen
if known_args.cmd == "cls":
os.system("cls||clear")
return None
return getattr(
self, "call_" + known_args.cmd, lambda: "Command not recognized!"
)(other_args)

View File

@@ -2,6 +2,7 @@
__docformat__ = "numpy"
import argparse
import os
import webbrowser
from prompt_toolkit.completion import NestedCompleter
from gamestonk_terminal import feature_flags as gtff
@@ -14,6 +15,8 @@ class ResourceCollectionController:
# Command choices
CHOICES = [
"cls",
"?",
"help",
"q",
"quit",
@@ -40,7 +43,8 @@ class ResourceCollectionController:
"https://github.com/GamestonkTerminal/GamestonkTerminal/tree/main/gamestonk_terminal/resource_collection"
)
print("\nResources:")
print(" help show this behavioural analysis menu again")
print(" cls clear screen")
print(" ?/help show this menu again")
print(" q quit this menu, and shows back to main menu")
print(" quit quit to abandon program")
print("")
@@ -62,8 +66,24 @@ class ResourceCollectionController:
True - quit the program
None - continue in the menu
"""
# Empty command
if not an_input:
print("")
return None
(known_args, other_args) = self.rc_parser.parse_known_args(an_input.split())
# Help menu again
if known_args.cmd == "?":
self.print_help()
return None
# Clear screen
if known_args.cmd == "cls":
os.system("cls||clear")
return None
if other_args:
print(f"The following args were unexpected: {other_args}")

View File

@@ -25,6 +25,8 @@ class ScreenerController:
# Command choices
CHOICES = [
"cls",
"?",
"help",
"q",
"quit",
@@ -57,7 +59,8 @@ class ScreenerController:
"https://github.com/GamestonkTerminal/GamestonkTerminal/tree/main/gamestonk_terminal/screener"
)
print("\nScreener:")
print(" help show this screener menu again")
print(" cls clear screen")
print(" ?/help show this menu again")
print(" q quit this menu, and shows back to main menu")
print(" quit quit to abandon program")
print("")
@@ -204,8 +207,24 @@ class ScreenerController:
True - quit the program
None - continue in the menu
"""
# Empty command
if not an_input:
print("")
return None
(known_args, other_args) = self.scr_parser.parse_known_args(an_input.split())
# Help menu again
if known_args.cmd == "?":
self.print_help()
return None
# Clear screen
if known_args.cmd == "cls":
os.system("cls||clear")
return None
return getattr(
self, "call_" + known_args.cmd, lambda: "Command not recognized!"
)(other_args)

View File

@@ -2,6 +2,7 @@
__docformat__ = "numpy"
import argparse
import os
from typing import List
from datetime import datetime
import pandas as pd
@@ -27,6 +28,8 @@ class TechnicalAnalysisController:
# Command choices
CHOICES = [
"cls",
"?",
"help",
"q",
"quit",
@@ -82,7 +85,8 @@ class TechnicalAnalysisController:
print(f"\n{s_intraday} Stock: {self.ticker}")
print("\nTechnical Analysis:") # https://github.com/twopirllc/pandas-ta
print(" help show this technical analysis menu again")
print(" cls clear screen")
print(" ?/help show this menu again")
print(" q quit this menu, and shows back to main menu")
print(" quit quit to abandon program")
print("")
@@ -122,8 +126,24 @@ class TechnicalAnalysisController:
True - quit the program
None - continue in the menu
"""
# Empty command
if not an_input:
print("")
return None
(known_args, other_args) = self.ta_parser.parse_known_args(an_input.split())
# Help menu again
if known_args.cmd == "?":
self.print_help()
return None
# Clear screen
if known_args.cmd == "cls":
os.system("cls||clear")
return None
return getattr(
self, "call_" + known_args.cmd, lambda: "Command not recognized!"
)(other_args)

View File

@@ -3,7 +3,7 @@
__docformat__ = "numpy"
import argparse
import os
import sys
from datetime import datetime, timedelta
from typing import List
@@ -75,6 +75,8 @@ class TerminalController:
]
CHOICES = [
"cls",
"?",
"help",
"quit",
"q",
@@ -130,7 +132,8 @@ class TerminalController:
"""Print help"""
help_text = """
What do you want to do?
help help to see this menu again
cls clear screen
?/help show this menu again
update update terminal from remote
reset reset terminal and reload configs
about about us
@@ -198,12 +201,27 @@ Contexts:
None - continue in the menu
"""
# Empty command
if not an_input:
print("")
return None
if not self.ticker and an_input in self.CHOICES_TICKER_DEPENDENT:
print("No ticker selected. Use 'load <ticker>'.\n")
return None
(known_args, other_args) = self.t_parser.parse_known_args(an_input.split())
# Help menu again
if known_args.cmd == "?":
self.print_help()
return None
# Clear screen
if known_args.cmd == "cls":
os.system("cls||clear")
return None
return getattr(
self, "call_" + known_args.cmd, lambda: "Command not recognized!"
)(other_args)