Small improvement on fa/analysis and new image for discord bot (#764)

* small improv on fa/analysis based on data author suggestion

* add image of logo with white background for discord bot
This commit is contained in:
DidierRLopes
2021-09-26 23:02:30 +01:00
committed by GitHub
parent 35f82f24ba
commit b60e34a0f0
2 changed files with 16 additions and 1 deletions

View File

@@ -2,6 +2,7 @@
__docformat__ = "numpy"
import requests
from colorama import Style
# pylint: disable=R1718
@@ -23,11 +24,25 @@ def get_filings_analysis(ticker: str) -> str:
if result.status_code == 200:
if result.json():
return "\n\n".join(
rf_highlights = f"{Style.BRIGHT}\n\tRISK FACTORS:{Style.RESET_ALL}\n"
rf_highlights_txt = "\n\n".join(
{sentence["sentence"] for sentence in result.json()[0]["rf_highlights"]}
)
daa_highlights = (
f"{Style.BRIGHT}\n\tDISCUSSION AND ANALYSIS:{Style.RESET_ALL}\n"
)
daa_highlights += "\n\n".join(
{
sentence["sentence"]
for sentence in result.json()[0]["daa_highlights"]
}
)
return (
rf_highlights + rf_highlights_txt + "\n" + daa_highlights
if rf_highlights_txt
else daa_highlights
)
return ""

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB