Allow user to configure papermill report notebook port

This commit is contained in:
didier
2021-04-25 15:10:00 +01:00
parent 518dd551d4
commit 5d8cf7534a
3 changed files with 11 additions and 2 deletions

View File

@@ -3,6 +3,9 @@ from dotenv import load_dotenv
load_dotenv()
# By default the jupyter notebook will be run on port 8888
PAPERMILL_NOTEBOOK_REPORT_PORT = "8888"
# https://www.alphavantage.co
API_KEY_ALPHAVANTAGE = os.getenv("GT_API_KEY_ALPHAVANTAGE") or "REPLACE_ME"

View File

@@ -4,6 +4,7 @@ __docformat__ = "numpy"
import argparse
from typing import List
from datetime import datetime
from gamestonk_terminal import config_terminal as cfg
import os
import webbrowser
import papermill as pm
@@ -65,5 +66,7 @@ def due_diligence(other_args: List[str]):
print("")
return
webbrowser.open(f"http://localhost:8888/notebooks/{analysis_notebook}")
webbrowser.open(
f"http://localhost:{cfg.PAPERMILL_NOTEBOOK_REPORT_PORT}/notebooks/{analysis_notebook}"
)
print("")

View File

@@ -4,6 +4,7 @@ __docformat__ = "numpy"
import argparse
from typing import List
from datetime import datetime
from gamestonk_terminal import config_terminal as cfg
import os
import webbrowser
import papermill as pm
@@ -54,5 +55,7 @@ def econ_data(other_args: List[str]):
print("")
return
webbrowser.open(f"http://localhost:8888/notebooks/{analysis_notebook}")
webbrowser.open(
f"http://localhost:{cfg.PAPERMILL_NOTEBOOK_REPORT_PORT}/notebooks/{analysis_notebook}"
)
print("")