Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/whitphx/stlite

Serverless Streamlit 🎈🚀
https://github.com/whitphx/stlite

hacktoberfest pyodide python streamlit wasm web-assembly webassembly

Last synced: about 1 month ago
JSON representation

Serverless Streamlit 🎈🚀

Awesome Lists containing this project

README

        

# Stlite: In-browser Streamlit

**Serverless [Streamlit](https://streamlit.io/) Running Entirely in Your Browser**

[![Test, Build, and Publish](https://github.com/whitphx/stlite/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/whitphx/stlite/actions/workflows/main.yml)
[![Build and Deploy GitHub Pages](https://github.com/whitphx/stlite/actions/workflows/gh-pages.yml/badge.svg)](https://github.com/whitphx/stlite/actions/workflows/gh-pages.yml)

[![npm (scoped)](https://img.shields.io/npm/v/@stlite/mountable?label=%40stlite%2Fmountable)](https://www.npmjs.com/package/@stlite/mountable)
[![npm (@stlite/desktop)](https://img.shields.io/npm/v/@stlite/desktop?label=%40stlite%2Fdesktop)](https://www.npmjs.com/package/@stlite/desktop)

Streamlit is a Python web app framework for the fast development of data apps. This project is to make it run completely on web browsers with the power of [Pyodide](https://pyodide.org/), WebAssembly (Wasm)-ported Python.

## Try it out online (_Stlite Sharing_)

Visit [Stlite Sharing](https://edit.share.stlite.net/).

[](https://edit.share.stlite.net/)

## Create a desktop app (`@stlite/desktop`)

See [`@stlite/desktop`](./packages/desktop/README.md).

## Use _Stlite_ on your web page (`@stlite/mountable`)

You can use _Stlite_ on your web page loading the script and CSS files via `` and `<link>` tags as below.
Here is a sample HTML file.

```html
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<title>Stlite App</title>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@stlite/[email protected]/build/stlite.css"
/>
</head>
<body>
<div id="root"></div>
<script src="https://cdn.jsdelivr.net/npm/@stlite/[email protected]/build/stlite.js">

stlite.mount(
`
import streamlit as st

name = st.text_input('Your name')
st.write("Hello,", name or "world")
`,
document.getElementById("root"),
);