conradbez/hstream
Sobre
Hyper Stream
Desenvolvimento web e de aplicativosO que você pode fazer
- 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:).
Crescimento medido de estrelas
- em 24 h
- 0
- em 7 dias
- 0
- em 15 dias
- 0
- em 1 mês
- Coletando histórico
Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.
README.md
OriginalHStream
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

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"])andwith 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@componentfor custom components. - Component packages: other packages can add components to
hsthrough an entry point.pip install "hstream[webawesome]"gives you all 78 Web Awesome components (from hstream import wa, thenwa.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'shx-postURL 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.pywrites a Dockerfile. - No server option:
hstream build app.py --servebuilds 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).

Technologies
Big thanks to Streamlit, htmx, Yattag, Pico CSS and Django.
Explore projetos relacionados
Carregando…