James McCool
commited on
Commit
·
39c4482
1
Parent(s):
21b08b7
updating the upload UI
Browse files
app.py
CHANGED
|
@@ -1307,8 +1307,9 @@ if selected_tab == 'Data Load':
|
|
| 1307 |
|
| 1308 |
with col1:
|
| 1309 |
st.subheader("Draftkings/Fanduel CSV")
|
| 1310 |
-
st.
|
| 1311 |
-
|
|
|
|
| 1312 |
|
| 1313 |
pricing_source = st.selectbox("Select a pricing source", options=['Paydirt DB', 'User Upload'])
|
| 1314 |
if 'csv_file' not in st.session_state:
|
|
@@ -1402,8 +1403,9 @@ if selected_tab == 'Data Load':
|
|
| 1402 |
|
| 1403 |
with col2:
|
| 1404 |
st.subheader("Portfolio File")
|
| 1405 |
-
st.
|
| 1406 |
-
|
|
|
|
| 1407 |
|
| 1408 |
upload_toggle = st.selectbox("What source are you uploading from?", options=['Paydirt DB', 'SaberSim (Just IDs)', 'Draftkings/Fanduel (Names + IDs)', 'Other (Just Names)'])
|
| 1409 |
if 'portfolio' not in st.session_state:
|
|
@@ -1548,8 +1550,9 @@ if selected_tab == 'Data Load':
|
|
| 1548 |
|
| 1549 |
with col3:
|
| 1550 |
st.subheader("Projections File")
|
| 1551 |
-
st.
|
| 1552 |
-
|
|
|
|
| 1553 |
proj_options = st.selectbox("Select a projections source", options=['Paydirt DB', 'User Upload'])
|
| 1554 |
|
| 1555 |
upload_col, template_col = st.columns([3, 1])
|
|
@@ -1624,13 +1627,14 @@ if selected_tab == 'Data Load':
|
|
| 1624 |
del st.session_state['projections_df']
|
| 1625 |
|
| 1626 |
with template_col:
|
| 1627 |
-
|
| 1628 |
-
|
| 1629 |
-
|
| 1630 |
-
|
| 1631 |
-
|
| 1632 |
-
|
| 1633 |
-
|
|
|
|
| 1634 |
|
| 1635 |
if st.session_state['projections_loaded']:
|
| 1636 |
export_projections, projections = load_file(st.session_state['db_projections_file'], site_var, type_var, sport_var, 'projections')
|
|
|
|
| 1307 |
|
| 1308 |
with col1:
|
| 1309 |
st.subheader("Draftkings/Fanduel CSV")
|
| 1310 |
+
with st.expander('Upload Info'):
|
| 1311 |
+
st.info("Upload the player pricing CSV from the site you are playing on")
|
| 1312 |
+
st.warning("Database load is active and in testing for Draftkings, not for Fanduel")
|
| 1313 |
|
| 1314 |
pricing_source = st.selectbox("Select a pricing source", options=['Paydirt DB', 'User Upload'])
|
| 1315 |
if 'csv_file' not in st.session_state:
|
|
|
|
| 1403 |
|
| 1404 |
with col2:
|
| 1405 |
st.subheader("Portfolio File")
|
| 1406 |
+
with st.expander('Upload Info'):
|
| 1407 |
+
st.info("Go ahead and upload a portfolio file here. Only include player columns.")
|
| 1408 |
+
st.warning("Database load is active and in testing for NBA, NFL, NHL, MMA, and PGA, both Classic and Regular")
|
| 1409 |
|
| 1410 |
upload_toggle = st.selectbox("What source are you uploading from?", options=['Paydirt DB', 'SaberSim (Just IDs)', 'Draftkings/Fanduel (Names + IDs)', 'Other (Just Names)'])
|
| 1411 |
if 'portfolio' not in st.session_state:
|
|
|
|
| 1550 |
|
| 1551 |
with col3:
|
| 1552 |
st.subheader("Projections File")
|
| 1553 |
+
with st.expander('Upload Info'):
|
| 1554 |
+
st.info("upload a projections file that has 'player_names', 'salary', 'median', 'ownership', and 'captain ownership' columns. Note that the salary for showdown needs to be the FLEX salary, not the captain salary.")
|
| 1555 |
+
st.warning("Database load is active and in testing for NBA, NFL, NHL, MMA, and PGA, both Classic and Regular")
|
| 1556 |
proj_options = st.selectbox("Select a projections source", options=['Paydirt DB', 'User Upload'])
|
| 1557 |
|
| 1558 |
upload_col, template_col = st.columns([3, 1])
|
|
|
|
| 1627 |
del st.session_state['projections_df']
|
| 1628 |
|
| 1629 |
with template_col:
|
| 1630 |
+
if proj_options == 'User Upload':
|
| 1631 |
+
template_df = pd.DataFrame(columns=['player_names', 'position', 'team', 'salary', 'median', 'ownership', 'captain ownership'])
|
| 1632 |
+
st.download_button(
|
| 1633 |
+
label="Template",
|
| 1634 |
+
data=template_df.to_csv(index=False),
|
| 1635 |
+
file_name="projections_template.csv",
|
| 1636 |
+
mime="text/csv"
|
| 1637 |
+
)
|
| 1638 |
|
| 1639 |
if st.session_state['projections_loaded']:
|
| 1640 |
export_projections, projections = load_file(st.session_state['db_projections_file'], site_var, type_var, sport_var, 'projections')
|