Skip to main content

Shiny bindings for Tabulator JS

Project description

py-tabulator: Tabulator for Python

Release pypi Build status License

Shiny for Python bindings for Tabulator JS

Features

  • Support for Shiny core and Shiny Express
  • Pagination
  • Filters
  • Editor with undo and redo (History interaction)
  • Grouping
  • Sorting
  • Column calculations
  • Downloads
  • Themes
  • Reactivity

Installation

# Stable
pip install pytabulator

# Dev
pip install git+https://github.com/eodaGmbH/py-tabulator

Docs

Basic usage

Shiny Express:

import pandas as pd
from pytabulator import TableOptions, render_data_frame
from shiny import render
from shiny.express import input, ui

ui.div("Click on row to print name", style="padding: 10px;")


@render.code
async def txt():
    print(input.tabulator_row_clicked())
    return input.tabulator_row_clicked()["Name"]


@render_data_frame(table_options=TableOptions(height=500))
def tabulator():
    return pd.read_csv(
        "https://raw.githubusercontent.com/datasciencedojo/datasets/master/titanic.csv"
    )

Shiny core:

# uvicorn docs.examples.getting_started.shiny_core_basic:app

import pandas as pd
from pytabulator import TableOptions, Tabulator, output_tabulator, render_tabulator
from shiny import App, render, ui

app_ui = ui.page_fluid(
    ui.output_text_verbatim("txt", placeholder=True),
    output_tabulator("tabulator"),
)


def server(input, output, session):
    @render_tabulator
    def tabulator():
        df = pd.read_csv(
            "https://raw.githubusercontent.com/datasciencedojo/datasets/master/titanic.csv"
        )
        return Tabulator(df, table_options=TableOptions(height=311))

    @render.code
    async def txt():
        print(input.tabulator_row_clicked())
        return str(input.tabulator_row_clicked())


app = App(app_ui, server)

Run detailed example:

shiny run docs/examples/getting_started/shiny_express_all.py

Development

Python

poetry install

poetry run pytest

JavaScript

npm install

npm run prettier

npm run build

Project details


Download files

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

Source Distribution

pytabulator-0.2.4.tar.gz (123.0 kB view details)

Uploaded Source

Built Distribution

pytabulator-0.2.4-py3-none-any.whl (148.1 kB view details)

Uploaded Python 3

File details

Details for the file pytabulator-0.2.4.tar.gz.

File metadata

  • Download URL: pytabulator-0.2.4.tar.gz
  • Upload date:
  • Size: 123.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.8.10 Linux/5.15.0-101-generic

File hashes

Hashes for pytabulator-0.2.4.tar.gz
Algorithm Hash digest
SHA256 779a1fa96d34dc3a8f523ba379edc9c82f0a2fcd9e942005ecb949d9c0fc2e2e
MD5 35622df56b16157aa12fe30839b0b89f
BLAKE2b-256 08ebe94288f4c9164c80b70443c1507084e258cc804456852a8b0c3911cce5f1

See more details on using hashes here.

File details

Details for the file pytabulator-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: pytabulator-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 148.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.8.10 Linux/5.15.0-101-generic

File hashes

Hashes for pytabulator-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 901abd8b89667544f72e9b95cf7c8c595585d3721d2b48afd4eaf054e3b3cb38
MD5 e90f360ea331c1b4f4545ac1ca83c55e
BLAKE2b-256 57375a500c84f920bf87bca75ee2f9ee56b52169daa74c8972b6f27c2136a62d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page