Skip to content
프로젝트

소개

Hyper Stream

웹 및 앱 개발

이 수치를 측정하는 방법

What you can do

  • Linear scripts. Inputs return values; each interaction reruns the script top to bottom.
  • Components: markdown, text/number inputs, sliders, select boxes, multiselects, checkboxes, buttons, file uploads, screenshots of the page or one element, matplotlib plots, pandas tables. Full list.
  • Placeholders: p = hs.placeholder() reserves a spot to fill or overwrite later in the script.
  • Navigation: page = hs.nav(["Home", "About"]) and with hs.nav_bar: render a nav bar where you call them (or in a placeholder: with header.nav_bar:).

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

HStream

Turn a Python script into an interactive web app:

from hstream import hs

name = hs.text_input("What's your name?")
hs.markdown(f"Hello, **{name}**!")

Powered by Django + htmx: plain HTML over HTTP, no JavaScript build step, deploys anywhere Django can, with four runtime dependencies. Inspired by Streamlit.

Usage

pip install hstream
hstream init            # writes example.py
hstream run example.py  # http://127.0.0.1:8000

hstream demo

Features

  • Linear scripts. Inputs return values; each interaction reruns the script top to bottom.
  • Components: markdown, text/number inputs, sliders, select boxes, multiselects, checkboxes, buttons, file uploads, screenshots of the page or one element, matplotlib plots, pandas tables. Full list.
  • Placeholders: p = hs.placeholder() reserves a spot to fill or overwrite later in the script.
  • Navigation: page = hs.nav(["Home", "About"]) and with hs.nav_bar: render a nav bar where you call them (or in a placeholder: with header.nav_bar:).
  • Your own HTML: with hs.html("section"):, Pico CSS theming, and @component for custom components.
  • Component packages: other packages can add components to hs through an entry point. pip install "hstream[webawesome]" gives you all 78 Web Awesome components (from hstream import wa, then wa.input(...); hstream-webawesome); pip install "hstream[3d]" adds clickable 3D viewers (viewer3d.model_viewer, viewer3d.babylon; hstream-3d); write your own.
  • Agent friendly: GET / returns the rendered page, and each control's hx-post URL is in the HTML, so another program (or LLM agent) can drive the app with plain HTTP and a cookie jar.
  • Easy deployment: hstream deploy app.py writes a Dockerfile.
  • No server option: hstream build app.py --serve builds a static site that runs in the browser with Pyodide (details).

In the browser (Pyodide)

The same script also runs with no server: hstream build writes a static site where Pyodide runs your Python in the visitor's browser.

hstream build app.py          # writes dist/ (index.html, hstream_browser.js, hstream.zip, app.py)
hstream build app.py --serve  # build and serve on http://127.0.0.1:8000, live-reloading edits to app.py
hstream build app.py --static              # one self-contained app.html (-o name.html to rename)
hstream build app.py --static --clipboard  # copy that HTML to the clipboard instead

The --static file opens straight from disk (double-click it) and can be emailed or pasted anywhere that takes HTML. Only Pyodide itself comes from its CDN.

Host dist/ on any static host (GitHub Pages, S3, Netlify), or put it in an existing page with <iframe src="dist/index.html"></iframe>. hstream boots Pyodide itself, so you don't need a PyScript <script type="py"> tag (and that route isn't supported). Pyodide's own packages (numpy, pandas, matplotlib) load from your imports. Other PyPI packages come from a requirements.txt next to your script (used automatically), or from -r humanize / -r other.txt. See docs/features/browser.md.

See motivation.md for the rationale and architecture.md for how it works. More examples are in demo/ (hstream run demo/nav_bar.py browses them).

hstream demo

Technologies

Big thanks to Streamlit, htmx, Yattag, Pico CSS and Django.

관련 프로젝트 살펴보기

불러오는 중…