streamlit-API

介绍

安装

pip install streamlit

streamlit-API_第1张图片

运行

streamlit run your_script.py [-- script args]

streamlit-API_第2张图片
streamlit-API_第3张图片

数据流

streamlit-API_第4张图片

多页应用程序

streamlit-API_第5张图片
streamlit-API_第6张图片

API

文本元素

streamlit-API_第7张图片

streamlit-API_第8张图片

数据元素

streamlit-API_第9张图片

图标元素

在这里插入图片描述
streamlit-API_第10张图片
streamlit-API_第11张图片

输入小部件

streamlit-API_第12张图片
streamlit-API_第13张图片
streamlit-API_第14张图片

媒体元素

streamlit-API_第15张图片

布局和容器

streamlit-API_第16张图片

聊天元素

streamlit-API_第17张图片

st.chat_message

streamlit-API_第18张图片
streamlit-API_第19张图片
streamlit-API_第20张图片

st.chat_input

streamlit-API_第21张图片
streamlit-API_第22张图片

显示进度和状态

streamlit-API_第23张图片
streamlit-API_第24张图片

控制流

streamlit-API_第25张图片

占位符/帮助/选项

streamlit-API_第26张图片

图表改变

streamlit-API_第27张图片

会话状态

在这里插入图片描述

初始化会话状态中的值

streamlit-API_第28张图片

读取和更新

streamlit-API_第29张图片

删除会话状态

streamlit-API_第30张图片

会话状态和小部件状态关联

streamlit-API_第31张图片

使用回调来更新会话状态

streamlit-API_第32张图片
streamlit-API_第33张图片

表单和回调

streamlit-API_第34张图片

注意事项和限制

streamlit-API_第35张图片
streamlit-API_第36张图片
streamlit-API_第37张图片

性能优化

streamlit-API_第38张图片

st.cache_data

streamlit-API_第39张图片
streamlit-API_第40张图片

st.cache_resource

streamlit-API_第41张图片

连接数据库

streamlit-API_第42张图片
streamlit-API_第43张图片

参考资料
Streamlit开发手册
Streamlit Documentation
streamlit/streamlit

你可能感兴趣的:(Streamlit,webui,Streamlit,API)