-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstreamlit_app.py
41 lines (25 loc) · 958 Bytes
/
streamlit_app.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
import re
from pathlib import Path
import streamlit as st
import pandas as pd
import datetime
from __main__ import get_camera_info
def sidebar_inputs():
# st.sidebar.sliderp
# st.sidebar.number_input
# year = st.sidebar.number_input('Year', 2020, now_year, now_year - 1)
# symbol = st.sidebar.text_input('Symbol', '').strip()
camera_data = get_camera_info(camera_id=None)
camera_data
df_trades, df_dividends = [post_process_df(df) for df in [df_trades, df_dividends]]
df_trades.quantity = df_trades.quantity.astype(float)
return df_trades, df_dividends
def main():
pd.options.display.float_format = '{:,.2f}'.format
df_trades, df_dividends = sidebar_inputs()
if st.checkbox("Show purchases table", False):
'##### Purchases', df_trades[df_trades.quantity >= 0]
'##### Sells:', df_trades[df_trades.quantity < 0]
'##### Dividends', df_dividends
f'#### Total dividents = ${df_dividends.amount.sum():3f}'
main()