Add flair

This commit is contained in:
Artem Veremey
2021-03-07 15:08:45 -08:00
parent 5517f1e82d
commit 907ff5d8b8
10 changed files with 57 additions and 10 deletions

View File

@@ -24,6 +24,7 @@ API_TWITTER_SECRET_KEY = os.getenv("GT_API_TWITTER_SECRET_KEY") or "REPLACE_ME"
API_TWITTER_BEARER_TOKEN = os.getenv("GT_API_TWITTER_BEARER_TOKEN") or "REPLACE_ME"
USE_COLOR = True
USE_FLAIR = "stars"
# Enable Prediction features
ENABLE_PREDICT = False

View File

@@ -9,6 +9,8 @@ from gamestonk_terminal.discovery import simply_wallst_api
from gamestonk_terminal.discovery import spachero_api
from gamestonk_terminal.discovery import unusual_whales_api
from gamestonk_terminal.helper_funcs import get_flair
def print_discovery():
""" Print help """
@@ -66,7 +68,7 @@ def disc_menu():
# Loop forever and ever
while True:
# Get input command from user
as_input = input("> ")
as_input = input(f"{get_flair()} (disc)> ")
# Parse fundamental analysis command of the list of possible commands
try:

View File

@@ -7,6 +7,8 @@ from gamestonk_terminal.due_diligence import quandl_api as q_api
from gamestonk_terminal.due_diligence import financial_modeling_prep_api as fmp_api
from gamestonk_terminal.due_diligence import business_insider_api as bi_api
from gamestonk_terminal.helper_funcs import get_flair
def print_due_diligence(s_ticker, s_start, s_interval):
""" Print help """
@@ -72,7 +74,7 @@ def dd_menu(df_stock, s_ticker, s_start, s_interval):
# Loop forever and ever
while True:
# Get input command from user
as_input = input("> ")
as_input = input(f"{get_flair()} (dd)> ")
# Parse due diligence command of the list of possible commands
try:

View File

@@ -9,6 +9,8 @@ from gamestonk_terminal.fundamental_analysis import market_watch_api as mw_api
from gamestonk_terminal.fundamental_analysis import business_insider_api as bi_api
from gamestonk_terminal.fundamental_analysis import yahoo_finance_api as yf_api
from gamestonk_terminal.helper_funcs import get_flair
def print_fundamental_analysis(s_ticker, s_start, s_interval):
""" Print help """
@@ -140,7 +142,7 @@ def fa_menu(s_ticker, s_start, s_interval):
# Loop forever and ever
while True:
# Get input command from user
as_input = input("> ")
as_input = input(f"{get_flair()} (fa)> ")
# Parse fundamental analysis command of the list of possible commands
try:

View File

@@ -12,6 +12,7 @@ import pandas as pd
import pandas.io.formats.format
from pandas._config.config import get_option
from pandas.plotting import register_matplotlib_converters
from gamestonk_terminal import config_terminal as cfg
register_matplotlib_converters()
@@ -310,3 +311,32 @@ def check_sources(source: str) -> str:
raise argparse.ArgumentTypeError(
"This source for historical data is not available."
)
def get_flair() -> str:
flair = {
"stars": "(✨)",
"baseball": "(⚾)",
"boat": "(⛵)",
"phone": "(☎)",
"mercury": "(☿)",
"sun": "(☼)",
"moon": "(☾)",
"nuke": "(☢)",
"hazard": "(☣)",
"tunder": "(☈)",
"king": "(♔)",
"queen": "(♕)",
"knight": "(♘)",
"recycle": "(♻)",
"scales": "(⚖)",
"ball": "(⚽)",
"golf": "(⛳)",
"piece": "(☮)",
"yy": "(☯)",
}
if flair.get(cfg.USE_FLAIR):
return flair[cfg.USE_FLAIR]
else:
return ""

View File

@@ -2,6 +2,8 @@ import argparse
from gamestonk_terminal.papermill import due_diligence
from gamestonk_terminal.helper_funcs import get_flair
def print_papermill():
""" Print help """
@@ -28,7 +30,7 @@ def papermill_menu():
while True:
# Get input command from user
as_input = input("> ")
as_input = input(f"{get_flair()} (mill)> ")
# Parse fundamental analysis command of the list of possible commands
try:

View File

@@ -8,6 +8,8 @@ from gamestonk_terminal.prediction_techniques import fbprophet
from gamestonk_terminal.prediction_techniques import neural_networks
import matplotlib.pyplot as plt
from gamestonk_terminal.helper_funcs import get_flair
def print_prediction(s_ticker, s_start, s_interval):
""" Print help """
@@ -67,7 +69,7 @@ def pred_menu(df_stock, s_ticker, s_start, s_interval):
# Loop forever and ever
while True:
# Get input command from user
as_input = input("> ")
as_input = input(f"{get_flair()} (pred)> ")
# Images are non blocking - allows to close them if we type other command
plt.close()

View File

@@ -5,6 +5,8 @@ from gamestonk_terminal.sentiment import google_api
from gamestonk_terminal import config_terminal as cfg
from gamestonk_terminal.helper_funcs import get_flair
# -----------------------------------------------------------------------------------------------------------------------
def print_sentiment():
@@ -78,7 +80,7 @@ def sen_menu(s_ticker, s_start):
# Loop forever and ever
while True:
# Get input command from user
as_input = input("> ")
as_input = input(f"{get_flair()} (sen)> ")
# Parse sentiment command of the list of possible commands
try:

View File

@@ -7,6 +7,8 @@ from gamestonk_terminal.technical_analysis import volatility as ta_volatility
from gamestonk_terminal.technical_analysis import volume as ta_volume
import matplotlib.pyplot as plt
from gamestonk_terminal.helper_funcs import get_flair
def print_technical_analysis(s_ticker, s_start, s_interval):
""" Print help """
@@ -72,7 +74,7 @@ def ta_menu(df_stock, s_ticker, s_start, s_interval):
# Loop forever and ever
while True:
# Get input command from user
as_input = input("> ")
as_input = input(f"{get_flair} (ta)> ")
# Images are non blocking - allows to close them if we type other command
plt.close()

View File

@@ -5,7 +5,7 @@ import pandas as pd
from alpha_vantage.timeseries import TimeSeries
from gamestonk_terminal.main_helper import print_help, clear, load, view, export
from gamestonk_terminal.helper_funcs import b_is_stock_market_open
from gamestonk_terminal.helper_funcs import b_is_stock_market_open, get_flair
from gamestonk_terminal.fundamental_analysis import fa_menu as fam
from gamestonk_terminal.technical_analysis import ta_menu as tam
@@ -64,7 +64,9 @@ def main():
)
# Print first welcome message and help
print("\nWelcome to Didier's Gamestonk Terminal\n")
print("")
print("🚀🚀 Welcome to Didier's Gamestonk Terminal!")
print("")
should_print_help = True
# Loop forever and ever
@@ -75,7 +77,7 @@ def main():
should_print_help = False
# Get input command from user
as_input = input("> ")
as_input = input(f"{get_flair()}> ")
# Is command empty
if not as_input: