mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-29 05:21:48 +00:00
* few changes * import fix * missed removing test config * column order fix * import fix * removed df2img add new deps * req * update readme * add dep for image export, fix * get rid of yahoo-fin, add image export lib * import issues in some machines fix * images dir fix * init fix * fix? * test * test * Fixed text handling Co-authored-by: Colin Delahunty <72827203+colin99d@users.noreply.github.com> Co-authored-by: DjangoServer <colin99delahunty@gmail.com>
30 lines
773 B
Python
30 lines
773 B
Python
import logging
|
|
|
|
from bots import config_discordbot as cfg
|
|
from gamestonk_terminal.decorators import log_start_end
|
|
from gamestonk_terminal.stocks.technical_analysis import finbrain_model
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
@log_start_end(log=logger)
|
|
def summary_command(ticker=""):
|
|
"""Displays text of a given stocks ta summary [FinBrain API]"""
|
|
|
|
# Debug
|
|
if cfg.DEBUG:
|
|
logger.debug("ta summary %s", ticker)
|
|
|
|
# Check for argument
|
|
if ticker == "":
|
|
raise Exception("Stock ticker is required")
|
|
|
|
report = finbrain_model.get_technical_summary_report(ticker)
|
|
if report:
|
|
report = "```" + report.replace(". ", ".\n") + "```"
|
|
|
|
return {
|
|
"title": "Stocks: [FinBrain API] Summary",
|
|
"description": report,
|
|
}
|