From b374e84e051834ff232df92b0dd01023cdad4402 Mon Sep 17 00:00:00 2001 From: Jeroen Bouma Date: Mon, 1 Nov 2021 17:39:41 +0100 Subject: [PATCH] Small tweaks to DCF and add thepassiveinvestor to requirements (#894) * Add the Finance Database to the ETF menu * Add the Finance Database to the stocks/discovery menu * Update website with Finance Database info * Update website sections of the Finance Database * Update Finance Database functions to match layout of controller modules * Merge website links * Add missing thepassiveinvestor dependency * Fix website bug * Name change * Update website with include exchanges parameter * Add include_exchanges, make searching less case sensitive, change market cap to millions and minor improvements * Change help message a bit * Adjust industry name if needed due to adjustments in the financedatabase creation * Make export path more robust which otherwise breaks when you rename the GST folder * Make path selection robust to also work when you run the terminal from a different directory * Make finding the right folder more elegant --- gamestonk_terminal/stocks/fundamental_analysis/dcf_model.py | 3 +++ gamestonk_terminal/stocks/fundamental_analysis/dcf_view.py | 3 +-- requirements-full.txt | 1 + requirements.txt | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gamestonk_terminal/stocks/fundamental_analysis/dcf_model.py b/gamestonk_terminal/stocks/fundamental_analysis/dcf_model.py index a010b5046cc..a58a7f802bf 100644 --- a/gamestonk_terminal/stocks/fundamental_analysis/dcf_model.py +++ b/gamestonk_terminal/stocks/fundamental_analysis/dcf_model.py @@ -220,6 +220,9 @@ def others_in_sector(ticker: str, sector: str, industry: str) -> List[str]: tickers : List[str] List of tickers in the same sector """ + industry = industry.replace("—", " - ") + industry = industry.replace("/", " ") + sister_ticks = list( fd.select_equities(country="United States", sector=sector, industry=industry) ) diff --git a/gamestonk_terminal/stocks/fundamental_analysis/dcf_view.py b/gamestonk_terminal/stocks/fundamental_analysis/dcf_view.py index 6f6098abec1..f632991e4da 100644 --- a/gamestonk_terminal/stocks/fundamental_analysis/dcf_view.py +++ b/gamestonk_terminal/stocks/fundamental_analysis/dcf_view.py @@ -77,8 +77,7 @@ class CreateExcelFA: self.run_audit() trypath = os.path.join( - "..", - "GamestonkTerminal", + os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "..")), "exports", "excel", f"{self.ticker} {self.now}.xlsx", diff --git a/requirements-full.txt b/requirements-full.txt index c56de7a12be..342ebf0e673 100644 --- a/requirements-full.txt +++ b/requirements-full.txt @@ -224,6 +224,7 @@ termcolor==1.1.0 terminado==0.12.1; python_version >= "3.6" testpath==0.5.0; python_version >= "3.7" textwrap3==0.9.2; python_version >= "3.6" +thepassiveinvestor==1.0.9 threadpoolctl==3.0.0; python_version >= "3.7" timeseries-cv==0.1.4; python_version >= "3.6" and python_version < "4.0" tokenize-rt==4.2.1; python_full_version >= "3.6.1" diff --git a/requirements.txt b/requirements.txt index 8ba359d9535..683ce1f3c30 100644 --- a/requirements.txt +++ b/requirements.txt @@ -201,6 +201,7 @@ termcolor==1.1.0 terminado==0.12.1; python_version >= "3.6" testpath==0.5.0; python_version >= "3.7" textwrap3==0.9.2; python_version >= "3.6" +thepassiveinvestor==1.0.9 threadpoolctl==3.0.0; python_version >= "3.7" timeseries-cv==0.1.4; python_version >= "3.6" and python_version < "4.0" tokenize-rt==4.2.1; python_full_version >= "3.6.1"