Spaces:
Build error
Build error
David Li commited on
Commit ·
6d5a213
1
Parent(s): bfde9fc
fix: try again
Browse files- pages/ta.py +11 -0
- pages/utils/util.py +0 -9
pages/ta.py
CHANGED
|
@@ -3,10 +3,21 @@ import datetime
|
|
| 3 |
import pandas as pd
|
| 4 |
import requests
|
| 5 |
import random
|
|
|
|
| 6 |
from pages.utils.util import remove_existing_file
|
| 7 |
from openbb_terminal.stocks.stocks_helper import load
|
| 8 |
from openbb_terminal.common.technical_analysis.volatility_view import display_bbands, display_donchian
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
st.write("""
|
| 11 |
# Technical Analysis Web Application
|
| 12 |
Leveraging the openbb sdk, we can build a web application to display
|
|
|
|
| 3 |
import pandas as pd
|
| 4 |
import requests
|
| 5 |
import random
|
| 6 |
+
import os
|
| 7 |
from pages.utils.util import remove_existing_file
|
| 8 |
from openbb_terminal.stocks.stocks_helper import load
|
| 9 |
from openbb_terminal.common.technical_analysis.volatility_view import display_bbands, display_donchian
|
| 10 |
|
| 11 |
+
stream = os.popen('cd ~ && pwd')
|
| 12 |
+
root_dir = stream.read()
|
| 13 |
+
# check for .openbb_terminal/env in root_dir
|
| 14 |
+
if os.path.exists(os.path.join(root_dir.strip(), ".openbb_terminal", ".env")) == False:
|
| 15 |
+
print("Did not find .openbb_terminal/.env")
|
| 16 |
+
# create it
|
| 17 |
+
os.mkdir(os.path.join(root_dir.strip(), ".openbb_terminal"))
|
| 18 |
+
# make .env file
|
| 19 |
+
env_file = open(os.path.join(root_dir.strip(), ".openbb_terminal", ".env"), "w")
|
| 20 |
+
|
| 21 |
st.write("""
|
| 22 |
# Technical Analysis Web Application
|
| 23 |
Leveraging the openbb sdk, we can build a web application to display
|
pages/utils/util.py
CHANGED
|
@@ -7,15 +7,6 @@ def remove_existing_file(func):
|
|
| 7 |
def wrapper(*args, **kwargs):
|
| 8 |
old_stdin = sys.stdin
|
| 9 |
sys.stdin = StringIO("y")
|
| 10 |
-
stream = os.popen('cd ~ && pwd')
|
| 11 |
-
root_dir = stream.read()
|
| 12 |
-
# check for .openbb_terminal/env in root_dir
|
| 13 |
-
if os.path.exists(os.path.join(root_dir.strip(), ".openbb_terminal", ".env")) == False:
|
| 14 |
-
print("Did not find .openbb_terminal/.env")
|
| 15 |
-
# create it
|
| 16 |
-
os.mkdir(os.path.join(root_dir.strip(), ".openbb_terminal"))
|
| 17 |
-
# make .env file
|
| 18 |
-
env_file = open(os.path.join(root_dir.strip(), ".openbb_terminal", ".env"), "w")
|
| 19 |
|
| 20 |
sample_dir = root_dir.strip()
|
| 21 |
# remove /home/codespace/OpenBBUserData/exports/bbands.png already
|
|
|
|
| 7 |
def wrapper(*args, **kwargs):
|
| 8 |
old_stdin = sys.stdin
|
| 9 |
sys.stdin = StringIO("y")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
sample_dir = root_dir.strip()
|
| 12 |
# remove /home/codespace/OpenBBUserData/exports/bbands.png already
|