Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.1.1 instead.
Reason given by maintainers: didnt put proper licenses

dash-univer

PyPI Python License: MIT

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 with Input("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

This wrapper is MIT licensed. Univer itself is Apache-2.0.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dash_univer-0.1.0.tar.gz (2.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dash_univer-0.1.0-py3-none-any.whl (2.6 MB view details)

Uploaded Python 3

File details

Details for the file dash_univer-0.1.0.tar.gz.

File metadata

  • Download URL: dash_univer-0.1.0.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

Hashes for dash_univer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1748acfde490a25cf3177fd68e088e4ff995003d9bbba730ddd3e547fb3e6b47
MD5 39d18b6990ee009bf3500ebf23fb9180
BLAKE2b-256 e16564a4c012e3e67c37a9c4c504b5cb3945a81dfa2b6f96f84923a1d1c41c3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for dash_univer-0.1.0.tar.gz:

Publisher: release.yml on azhar9/dash-univer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dash_univer-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dash_univer-0.1.0-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

Hashes for dash_univer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 af6123026df132ea0135753d59c8a5df61ab9b598894a898043b2f6ffd95eca4
MD5 f193c4a820f1f94cd059fe3ab4a69f55
BLAKE2b-256 3303e608aab3008e964d34c54797f1219957012a139e8edbb61b27e276fc8ea2

See more details on using hashes here.

Provenance

The following attestation bundles were made for dash_univer-0.1.0-py3-none-any.whl:

Publisher: release.yml on azhar9/dash-univer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.1

2 files

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page