File size: 888 Bytes
31e15be
 
 
 
 
83551c4
6947348
83551c4
31e15be
 
 
 
 
 
 
 
83551c4
 
6947348
 
 
83551c4
 
 
 
31e15be
 
 
 
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
import streamlit as st

from config import DEFAULT_ICON
from shared_page import common_page_config

from load_options import load_options
from domain.playoffs import CURRENT_PLAYOFF_WEEK
from format_player_html import get_all_position_week_html_str


def get_page():
    page_title = "Top Players"
    st.set_page_config(page_title=page_title, page_icon=DEFAULT_ICON, layout="wide")
    common_page_config()
    st.title(page_title)

    all_options = load_options()

    weeks = [1, 2, 3, 4]
    current_week_index = weeks.index(CURRENT_PLAYOFF_WEEK)
    week = st.selectbox("Select Week", weeks, index=current_week_index)
    for pos in ["QB", "RB", "WR", "TE", "K", "DEF"]:
        st.header(pos)
        week_pos_list = all_options[pos][week]
        st.markdown(get_all_position_week_html_str(week, week_pos_list), unsafe_allow_html=True)


if __name__ == "__main__":
    get_page()