Getting Started
Installation
pip install webwrench
webwrench has zero runtime dependencies. The bitwrench.js frontend is bundled inside the package.
Optional: pandas support
pip install webwrench[pandas]
Development install
git clone https://github.com/deftio/webwrench.git
cd webwrench
pip install -e ".[dev]"
Your First App
Create a file called app.py:
import webwrench as ww
ww.title("Hello World")
ww.text("Welcome to webwrench!")
ww.serve()
Run it:
python app.py
Open http://localhost:6502 in your browser. You should see your title and text rendered.
Adding Interactivity
Add a slider that controls a chart:
import webwrench as ww
data = [12, 19, 3, 5, 2, 3]
ww.title("Interactive Chart")
chart = ww.chart(data, type="bar", labels=["A", "B", "C", "D", "E", "F"])
slider = ww.slider("Scale", min=1, max=5, value=1)
@slider.on_change
def on_scale(value):
chart.update([d * value for d in data])
ww.serve()
Static Export
Don't need a live server? Export to a self-contained HTML file:
import webwrench as ww
ww.title("Report")
ww.table([
["Product", "Sales"],
["Widget A", 120],
["Widget B", 85],
])
ww.export("report.html")
Open report.html in any browser — no server needed.
Next Steps
- Script Mode guide — learn the flat-script API
- App Mode guide — multi-page apps with routing
- Charts guide — all chart types and options
- Examples — runnable example scripts