import streamlit as st
import numpy as np
import pandas as pd
print("\x1b[1;92mStreamlit script running...\x1b[0m")
st.title("streamlit on pycafe")
st.markdown(
"""
Py.cafe is a platform that allows you to create, run, edit, and share Python applications directly in your browser. There's
no need for any installation; it works with just a single click.
And now, you can use Streamlit on py.cafe! Streamlit is a popular Python library for creating web applications with simple
Python scripts. You can create interactive web applications with just a few lines of code.
"""
)
st.header("Example components")
st.subheader("Text input")
name = st.text_input("Your name?")
st.write("Hello,", name or "world", "!")
st.sidebar.header("Configuration")
# Input for stock ticker and date range
ticker = st.sidebar.text_input("Enter Stock Ticker (e.g., AAPL):", "AAPL")
start_date = st.sidebar.date_input("Start Date", value=pd.to_datetime("2023-01-01"))
end_date = st.sidebar.date_input("End Date", value=pd.to_datetime("2024-12-14"))
st.sidebar.subheader("Technical Indicators")
indicators = st.sidebar.multiselect(
"Select Indicators:",
["20-Day SMA", "20-Day EMA", "20-Day Bollinger Bands", "VWAP"],
default=["20-Day SMA"]
)
# st.subheader("Slider")
# value = st.slider("Value?")
# st.write("The slider value is", value)
# st.subheader("Chart sample")
# chart_data = pd.DataFrame(np.random.randn(20, 3), columns=["a", "b", "c"])
# st.area_chart(chart_data)
# st.subheader("DataFrame sample")
# df = pd.DataFrame(np.random.randn(50, 20), columns=("col %d" % i for i in range(20)))
# st.dataframe(df) # Same as st.write(df)
# st.subheader("Camera and image")
# if st.checkbox("Show camera"):
# picture = st.camera_input("Take a picture")
# if picture:
# st.image(picture)