Skip to main content

spaday-regular-table

Viewport-virtualized data tables for spaday, powered by regular-table.

Build Status codecov License PyPI

Documentation

Quick example

from spaday import CallEndpoint, event_value, serve
from spaday_regular_table import RegularTable

rows = [{"id": i, "symbol": f"SYM{i}", "price": i / 10} for i in range(100_000)]

table = RegularTable(
    columns=[
        "id",
        {
            "key": "symbol",
            "label": "Symbol",
            "cell": {"tag": "button", "class": "symbol-button", "event": "symbol-click"},
        },
        {"key": "price", "label": "Last price", "cell": {"format": "number", "digits": 2}},
    ],
    rows=rows,
    row_header="id",
    style="height: 32rem",
).on("symbol-click", CallEndpoint("POST", "/api/click", event_value()))

serve(table, packages=["regular-table"])

Only cells requested for the current viewport are copied into regular-table and rendered. rows remains a browser-side record array. columns accepts keys or {key, label, cell} objects and is inferred from the first row when omitted. A cell descriptor can wrap the displayed value in an HTML or custom-element tag, apply classes and attributes, or format numeric values. The wrapper performs that work only for visible cells.

For hot server pushes, set stream_url to an SSE endpoint whose messages are row patches. You can also bind rowPatch to CallEndpoint(result=...) state for request/response updates. Each patch contains revisioned update, insert, and remove operations, so a 100,000-row list is not recopied. The browser methods remain available to integration authors, but applications need no JavaScript callback.

cell-click exposes event.detail with type, virtual x/y, column, value, and the source row, so normal spaday actions can handle interactions. virtual_mode supports upstream both, horizontal, vertical, and none; keep both for large datasets.

Run the local example

python -m pip install -e ".[examples]"
python -m spaday_regular_table.example

Open http://127.0.0.1:8014 to inspect the complete market-blotter example: 100,000 virtualized rows, a server row stream, full-width sizing, rich cells, and server-authoritative update, insert, remove, and click operations. All interaction is authored in Python; there is no companion example.js. It passes the local package descriptor directly, so it does not install or resolve the integration from GitHub.

Metadata

Release files for spaday-regular-table 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spaday-regular-table 0.2.1
File Size Uploaded
spaday_regular_table-0.2.1.tar.gz 121.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spaday-regular-table 0.2.1
File Interpreter ABI Platform
spaday_regular_table-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 203.7 kB

Release files / spaday_regular_table-0.2.1.tar.gz

Download URL spaday_regular_table-0.2.1.tar.gz
Size 121.0 kB
Tags Source
SHA-256 checksum
How to use checksums
693afb28c242541b9990a4c42961e049537b3e0ec4d80dedf6fe98d94ec45c88
BLAKE2b-256 checksum
How to use checksums
f200d9c00b8ca8bacc1580b76bfda60b00f30332eb060181096d208869f94bc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / spaday_regular_table-0.2.1-py3-none-any.whl

Download URL spaday_regular_table-0.2.1-py3-none-any.whl
Size 82.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5df724d511c08ae506c8fe58fbef0d374b14b503fda3deb537aa5b7e80934ffa
BLAKE2b-256 checksum
How to use checksums
c3eb55d83ff57a3e3425a1acfc92a8b3cc2b1ee87c964474a629bf22b49951b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release history Release notifications | RSS feed

0.3.0

2 release files

0.2.2

2 release files

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release 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