Skip to content

Franky1/Streamlit-Sharing-Test

Repository files navigation

Streamlit Sharing Test

Public repo for playing and testing with the Streamlit sharing runtime.

As long as the app will be available on Streamlit Sharing, it can be found at this URL:

https://share.streamlit.io/franky1/streamlit-sharing-test/main

Features

This app is designed to explore the Streamlit Sharing runtime a bit.

  • Show Python version of runtime
  • Show basic system information
  • List all installed apt packages
  • List all installed pip packages
  • List all installed pip trees
  • List all available python modules
  • Manually run shell commands in the runtime
  • Export runtime informations to file

Printing Pretty Tables with Python

Tutorials


Checking apt packages

Checking apt packages manually with OS tools

apt list --installed
dpkg --list
dpkg-query --show --showformat=format

dpkg-query

https://man7.org/linux/man-pages/man1/dpkg-query.1.html

python-apt

Not cross-platform? No actual pip repo package available? No success yet to install this package under Debian

Checking pip packages

Checking pip packages manually with pip

pip freeze
pip list --format columns
pip list --format freeze
pip list --format json

piptree

importlib


Plotly Tables in Streamlit

Plotly Table example

import plotly.graph_objects as go

fig = go.Figure(data=[go.Table(
    header=dict(values=['A', 'B']),
    cells=dict(values=[[10, 20, 30, 40],
                       [40, 20, 10, 50]]))
    ])
fig.show()

Lokal Docker Streamlit runtime

A Dockerfile is also provided for local testing of the Streamlit app.

docker build -t streamlittest:latest .
docker run -ti -p 8501:8501 --rm streamlittest:latest
docker run -ti -p 8501:8501 --rm streamlittest:latest /bin/bash
docker run -ti -p 8501:8501 -v $(pwd):/app --rm streamlittest:latest  # linux
docker run -ti -p 8501:8501 -v ${pwd}:/app --rm streamlittest:latest  # powershell
docker run -ti -p 8501:8501 -v %cd%:/app --rm streamlittest:latest  # cmd.exe
docker run -ti --rm python:3.9-slim /bin/bash # testing python container

Open local docker streamlit app site: http://localhost:8501/

Port 8501 is the default port for Streamlit.


Status

  • Last changes: 14.03.2022

About

Public repo for test projects with Streamlit Cloud

Topics

Resources

License

Stars

Watchers

Forks