dash-univer
A Dash component that embeds the Univer spreadsheet — a full-featured, Excel-like sheet with formulas — directly in your Dash app, wired to Dash callbacks.
pip install dash-univer
Quick start
from dash import Dash, html, Input, Output
from dash_univer import UniverSheet
app = Dash(__name__)
app.layout = html.Div([
UniverSheet(id="sheet", data={
"id": "wb",
"name": "My Workbook",
"sheetOrder": ["s1"],
"sheets": {
"s1": {
"id": "s1",
"name": "Sheet1",
"cellData": {
"0": {"0": {"v": "Product"}, "1": {"v": "Revenue"}},
"1": {"0": {"v": "Widget"}, "1": {"v": 1000}},
},
},
},
}),
html.Pre(id="out"),
])
@app.callback(Output("out", "children"), Input("sheet", "data"))
def show(data):
return f"{len(data.get('sheets', {}))} sheet(s) in the workbook"
if __name__ == "__main__":
app.run(debug=True)
Run python usage.py in this repo for a fuller live demo.
How it works
UniverSheet mounts a Univer spreadsheet into a <div>. Univer runs in its own
isolated React root inside that div, so it never conflicts with Dash's React tree.
The data prop is the whole workbook (Univer's
IWorkbookData
as a plain dict) and syncs both ways:
- Sheet → Python: as the user edits, a debounced full snapshot of the
workbook is pushed to
data, so any callback withInput("sheet", "data")sees the current state. - Python → Sheet: returning a workbook from a callback's
Output("sheet", "data")re-renders the sheet. The component guards against echoing its own snapshots, so this never causes a feedback loop.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
id |
string | – | Component id for Dash callbacks. |
data |
dict | {} |
The workbook (IWorkbookData). Round-trips both ways. |
debounce |
number | 300 |
Milliseconds to debounce edit → data updates. |
style |
dict | {height: "500px", width: "100%"} |
Container styles. Give it a height — Univer collapses to zero height otherwise. |
className |
string | – | Container CSS class. |
Advanced: the live Univer
Facade API is
exposed as document.getElementById(id).univerAPI for client-side callbacks or
custom JS.
Development
Requires Python ≥3.9, Node ≥18, and Chrome (for the tests).
uv venv && source .venv/bin/activate
uv pip install -e ".[dev]"
npm install
npm run build # webpack bundle + generates the Python classes
python usage.py # live demo at http://127.0.0.1:8050
pytest --headless # end-to-end tests (real browser)
npm run build runs webpack (bundling Univer, with React/ReactDOM externalized
to the ones Dash provides) and then dash-generate-components, which regenerates
dash_univer/UniverSheet.py from the component's PropTypes.
The tests use dash.testing with Selenium; they need a chromedriver matching
your installed Chrome on PATH (see
Chrome for Testing).
Scope
v1 wraps Univer Sheets (@univerjs/preset-sheets-core) in English. Docs,
Slides, other locales, and granular per-cell events are intentionally out of
scope for now — the full-snapshot data contract already exposes everything.
License
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dash_univer-0.1.1.tar.gz.
File metadata
- Download URL: dash_univer-0.1.1.tar.gz
- Upload date:
- Size: 2.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c66cc0e6408686f8893d6cef54c6ec00347ac4b0f1a64bd96edc5628188ee77
|
|
| MD5 |
2679e0a8eaf95fec85eee6f9e44f99aa
|
|
| BLAKE2b-256 |
d881b2ec3c970ac333acd8d37ca9ea0b9f052513825215f3a067825e543516ad
|
Provenance
The following attestation bundles were made for dash_univer-0.1.1.tar.gz:
Publisher:
release.yml on azhar9/dash-univer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dash_univer-0.1.1.tar.gz -
Subject digest:
8c66cc0e6408686f8893d6cef54c6ec00347ac4b0f1a64bd96edc5628188ee77 - Sigstore transparency entry: 2446047886
- Sigstore integration time:
-
Permalink:
azhar9/dash-univer@c669fe2ca9f04cf97845b0fb44498ec8ada57144 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/azhar9
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c669fe2ca9f04cf97845b0fb44498ec8ada57144 -
Trigger Event:
push
-
Statement type:
File details
Details for the file dash_univer-0.1.1-py3-none-any.whl.
File metadata
- Download URL: dash_univer-0.1.1-py3-none-any.whl
- Upload date:
- Size: 2.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73904e55a069a6347f165301a154de196d351be76761629d98b51dd8ce2a9ce7
|
|
| MD5 |
beb3ca22dce76a5e206d88be81f78ba7
|
|
| BLAKE2b-256 |
5f30397056c18812281cfd3ab869928814f4a79b312de245c2ef1bb292cda9ee
|
Provenance
The following attestation bundles were made for dash_univer-0.1.1-py3-none-any.whl:
Publisher:
release.yml on azhar9/dash-univer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dash_univer-0.1.1-py3-none-any.whl -
Subject digest:
73904e55a069a6347f165301a154de196d351be76761629d98b51dd8ce2a9ce7 - Sigstore transparency entry: 2446047997
- Sigstore integration time:
-
Permalink:
azhar9/dash-univer@c669fe2ca9f04cf97845b0fb44498ec8ada57144 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/azhar9
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c669fe2ca9f04cf97845b0fb44498ec8ada57144 -
Trigger Event:
push
-
Statement type: