Metadata-Version: 2.4
Name: egui-workbench
Version: 0.17.0
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Rust
Classifier: Topic :: Software Development :: User Interfaces
Requires-Dist: numpy>=1.23 ; extra == 'data'
Requires-Dist: pytest>=8 ; extra == 'test'
Provides-Extra: data
Provides-Extra: test
Summary: Native, IDE-grade workbench windows from a Python script.
Keywords: egui,gui,workbench,data,plots
Author: Jose Ignacio Gonzalez
License: MIT OR Apache-2.0
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://jigonzalez930209.github.io/egui-workbench/guide/python.html
Project-URL: Homepage, https://github.com/jigonzalez930209/egui-workbench
Project-URL: Repository, https://github.com/jigonzalez930209/egui-workbench

# egui-workbench (Python)

Native, IDE-grade workbench windows from a Python script, with no Rust toolchain.

```bash
pip install egui-workbench
```

```python
from egui_workbench import Workbench, Command, Label, Button

app = Workbench(title="My App", theme="github-dark")
app.add(Label("Hello from Python"), Button("greet", "Greet"))
app.menu("File", [Command("save", "Save", shortcut="Ctrl+S")])

@app.on("greet")
def greet(ctx):
    ctx.toast.success("Hello")

@app.on("save")
def save(ctx):
    ctx.toast.success("Saved")

app.run()
```

- `Workbench` builds the versioned host spec and opens the native window through PyO3.
- Widgets are dataclasses: `Label`, `Button`, `TextField`, `Checkbox`, `Switch`,
  `Select`, `Slider`, `Row`, `Column`, `Card`, `Tabs`, `Tree`, `DataGrid`, `Plot`, and
  `Custom`.
- `@app.on("command")` handlers run on the UI thread. `ctx.set`, `ctx.append`,
  `ctx.toast`, and `ctx.quit` are safe to call there.
- `app.post(callback)` runs work on the UI thread from any thread; `async` handlers run
  on an asyncio loop while the window is open; `await app.run_async()` is available in
  notebooks.
- `app.dataset(name, data)` accepts NumPy, pandas, Polars, PyArrow, mappings, and rows.
- `app.step(frames=1)` renders headless for tests and conformance.
- `app.schema()` is the JSON Schema generated from the Rust host types.

The wheel is built with maturin and abi3 for CPython 3.9+.

