-
Notifications
You must be signed in to change notification settings - Fork 0
/
maindsb.py
97 lines (87 loc) · 2.61 KB
/
maindsb.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
"""
maindsv.py
Copyright (c) leonardo-rocchi:z4ir3
"""
import streamlit as st
# Importing absolute path for deployment as streamlit app
import sys
sys.path.insert(1,"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/streamlit_option_menu")
from streamlit_option_menu import option_menu
from src.pricing import dbpage_pricing
from src.strategies import dbpage_strategies
def main():
"""
"""
# Page configuration
# Streamlit supported icons:
# https://streamlit-emoji-shortcodes-streamlit-app-gwckff.streamlit.app/
st.set_page_config(
page_title = "Option Playground",
page_icon = ":arrows_counterclockwise:",
layout = "wide",
initial_sidebar_state = "expanded",
menu_items={
"About": "# Option playground"
}
)
# Remove extra white space
st.write('''
<style>
div.block-container {
padding-top: 0rem;
}
</style>
''',
unsafe_allow_html = True
)
with st.sidebar:
# Sidebar title
st.sidebar.title("")
PageSelected = option_menu(
menu_title = "Option Playgrounds",
menu_icon = "bar-chart",
options=[
# "Home",
"Option Pricing",
"Option Strategies"
],
icons = [
# "house",
"box-arrow-in-right",
"stack"
], # icons from the bootstrap webpage
default_index = 0,
orientation = "vertical",
# orientation = "horizontal"
# styles={
# "container": {"padding": "0!important", "background-color": "#fafafa"},
# "icon": {"color": "orange", "font-size": "25px"},
# "nav-link": {"font-size": "25px", "text-align": "left", "margin":"0px", "--hover-color": "#eee"},
# "nav-link-selected": {"background-color": "green"},
# }
styles={
"nav-link": {"--hover-color": "#aaa"},
}
)
# ss = """
# <style>
# .nav-link:hover {
# color:rgb(100,100,150);
# }
# </style>
# """
# st.markdown(ss, unsafe_allow_html=True)
if PageSelected == "Option Pricing":
_ = dbpage_pricing()
else:
_ = dbpage_strategies()
# Hiding "Made with Streamlit message"
st.write('''
<style>
footer {visibility:hidden;}
</style>
''',
unsafe_allow_html = True
)
if __name__ == "__main__":
main()