https://github.com/zengbin93/czsc_stremlit
使用 streamlit 进行可视化呈现
https://github.com/zengbin93/czsc_stremlit
Last synced: 12 months ago
JSON representation
使用 streamlit 进行可视化呈现
- Host: GitHub
- URL: https://github.com/zengbin93/czsc_stremlit
- Owner: zengbin93
- License: apache-2.0
- Created: 2023-04-27T12:28:32.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-10T08:25:09.000Z (about 2 years ago)
- Last Synced: 2025-04-14T08:41:40.292Z (about 1 year ago)
- Language: Python
- Size: 20.4 MB
- Stars: 28
- Watchers: 2
- Forks: 14
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# czsc_stremlit
使用 streamlit 进行可视化呈现
#### 本地环境运行
```shell
# PS: 本地环境运行需提前安装好ta-lib库(根据自己的操作系统自行Google)
# 1. 安装依赖
pip install ta-lib && pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
# 2. 创建.streamlit/secrets.toml配置文件
touch .streamlit/secrets.toml
# 文件内容如下,填入自己的参数即可
ts_token = "xxx"
OPENAI_API_KEY = "xxx"
OPENAI_API_BASE = "xxx"
ACTIVELOOP_TOKEN = "xxx"
allow_gpt4_users = ['xxx@xxx.com']
# 3. 启动服务
streamlit run CZSC.py
```
#### Docker方式运行
```shell
# 构建Docker镜像
docker build -t czsc-stremlit:0.0.1 .
# 运行镜像
# docker run -d -p 8501:80 --volume .streamlit/secrets.toml:/app/.streamlit/secrets.toml --name czsc-stremlit czsc-stremlit:0.0.1
docker run -d -p 8501:80 --name czsc-stremlit czsc-stremlit:0.0.1
########## 以下为Docker常用的命令 ##########
# 查看容器日志
docker logs --tail=100 -f czsc-stremlit
# 进入容器命令行
docker exec -it czsc-stremlit bash
# 停止容器
docker stop czsc-stremlit
# 重启容器
docker restart czsc-stremlit
# 启动容器
docker start czsc-stremlit
# 查看容器状态
docker ps -a
```