Streamlit for Go

github.com/malcolmston/streamlit

Turn a Go function into an interactive data app.

 GitHubports streamlit/streamlit

A from-scratch, dependency-free port of Streamlit. Write an app function, call display and widget methods top-to-bottom on a Session, and st.Run serves it over HTTP with a small embedded web UI — no JavaScript build step, no external charting library, standard library only.

Install

shell
$ go get github.com/malcolmston/streamlit

Quick start

main.go
func app(s *st.Session) {
    s.Title("Hello, Streamlit-Go")

    if s.Button("go") {
        s.Write("clicked!")
    }

    n := s.Slider("n", 0, 100, 50, 1)
    s.Write(n)
}

st.Run(app, ":8501")

Features

  • Write an app as func(s *st.Session), run top-to-bottom
  • Widgets: Button, Slider, Checkbox, TextInput, SelectBox
  • Display: Title, Header, Markdown, Write, Table, Metric
  • Built-in LineChart — no external charting library
  • Automatic re-run on interaction with per-session state
  • st.Run(app, ":8501") serves it with an embedded web UI
Streamlit