Files
OpenBB/bots/stocks/technical_analysis/summary.py
teh_coderer a36da387e2 fixes/tbl-columns-width/refactor (#1527)
* 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>
2022-03-21 11:54:19 -04:00

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