pytabulator


Namepytabulator JSON
Version 0.2.5 PyPI version JSON
download
home_pageNone
SummaryShiny bindings for Tabulator JS
upload_time2024-09-06 06:52:22
maintainerNone
docs_urlNone
authorStefan Kuethe
requires_python<4.0,>=3.9
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # py-tabulator: Tabulator for Python

[![Release](https://img.shields.io/github/v/release/eodaGmbH/py-tabulator)](https://img.shields.io/github/v/release/eodaGmbH/py-tabulator)
[![pypi](https://img.shields.io/pypi/v/pytabulator.svg)](https://pypi.python.org/pypi/pytabulator)
[![Build status](https://img.shields.io/github/actions/workflow/status/eodaGmbH/py-tabulator/pytest.yml?branch=main)](https://img.shields.io/github/actions/workflow/status/eodaGmbH/py-tabulator/pytest.yml?branch=main)
[![License](https://img.shields.io/github/license/eodaGmbH/py-tabulator)](https://img.shields.io/github/license/eodaGmbH/py-tabulator)
[![License](https://img.shields.io/github/license/eodaGmbH/py-maplibregl)](https://img.shields.io/github/license/eodaGmbH/py-maplibregl)
[![Tabulator](https://img.shields.io/badge/Tabulator-v6.2.1-blue.svg)](https://github.com/olifolkerd/tabulator/releases/tag/6.2.1)

[Shiny for Python](https://shiny.posit.co/py/) bindings for [Tabulator JS](https://tabulator.info/)

## Features

- Support for [Shiny core](https://shiny.posit.co/py/) and [Shiny Express](https://shiny.posit.co/blog/posts/shiny-express/)
- Pagination
- Filters
- Editor with undo and redo (History interaction)
- Grouping
- Sorting
- Column calculations
- Downloads
- Themes
- Reactivity

## Installation

```bash
# Stable
pip install pytabulator

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

## Docs

- https://eodagmbh.github.io/py-tabulator/

## Basic usage

[Shiny Express](https://shiny.posit.co/blog/posts/shiny-express/):

```python
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](https://shiny.posit.co/py/):

```python
# 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:

```bash
shiny run docs/examples/getting_started/shiny_express_all.py
```

![](docs/images/shiny-express-detailed-example.png)

## Development

### Python

```bash
poetry install

poetry run pytest
```

### JavaScript

```bash
npm install

npm run prettier

npm run build
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pytabulator",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "Stefan Kuethe",
    "author_email": "stefan.kuethe@eoda.de",
    "download_url": "https://files.pythonhosted.org/packages/94/e1/dd28dd0e0121ea40e08a89191b5da0ff8ef833e8969a6fd4ba5dcb45483a/pytabulator-0.2.5.tar.gz",
    "platform": null,
    "description": "# py-tabulator: Tabulator for Python\n\n[![Release](https://img.shields.io/github/v/release/eodaGmbH/py-tabulator)](https://img.shields.io/github/v/release/eodaGmbH/py-tabulator)\n[![pypi](https://img.shields.io/pypi/v/pytabulator.svg)](https://pypi.python.org/pypi/pytabulator)\n[![Build status](https://img.shields.io/github/actions/workflow/status/eodaGmbH/py-tabulator/pytest.yml?branch=main)](https://img.shields.io/github/actions/workflow/status/eodaGmbH/py-tabulator/pytest.yml?branch=main)\n[![License](https://img.shields.io/github/license/eodaGmbH/py-tabulator)](https://img.shields.io/github/license/eodaGmbH/py-tabulator)\n[![License](https://img.shields.io/github/license/eodaGmbH/py-maplibregl)](https://img.shields.io/github/license/eodaGmbH/py-maplibregl)\n[![Tabulator](https://img.shields.io/badge/Tabulator-v6.2.1-blue.svg)](https://github.com/olifolkerd/tabulator/releases/tag/6.2.1)\n\n[Shiny for Python](https://shiny.posit.co/py/) bindings for [Tabulator JS](https://tabulator.info/)\n\n## Features\n\n- Support for [Shiny core](https://shiny.posit.co/py/) and [Shiny Express](https://shiny.posit.co/blog/posts/shiny-express/)\n- Pagination\n- Filters\n- Editor with undo and redo (History interaction)\n- Grouping\n- Sorting\n- Column calculations\n- Downloads\n- Themes\n- Reactivity\n\n## Installation\n\n```bash\n# Stable\npip install pytabulator\n\n# Dev\npip install git+https://github.com/eodaGmbH/py-tabulator\n```\n\n## Docs\n\n- https://eodagmbh.github.io/py-tabulator/\n\n## Basic usage\n\n[Shiny Express](https://shiny.posit.co/blog/posts/shiny-express/):\n\n```python\nimport pandas as pd\nfrom pytabulator import TableOptions, render_data_frame\nfrom shiny import render\nfrom shiny.express import input, ui\n\nui.div(\"Click on row to print name\", style=\"padding: 10px;\")\n\n\n@render.code\nasync def txt():\n    print(input.tabulator_row_clicked())\n    return input.tabulator_row_clicked()[\"Name\"]\n\n\n@render_data_frame(table_options=TableOptions(height=500))\ndef tabulator():\n    return pd.read_csv(\n        \"https://raw.githubusercontent.com/datasciencedojo/datasets/master/titanic.csv\"\n    )\n```\n\n[Shiny core](https://shiny.posit.co/py/):\n\n```python\n# uvicorn docs.examples.getting_started.shiny_core_basic:app\n\nimport pandas as pd\nfrom pytabulator import TableOptions, Tabulator, output_tabulator, render_tabulator\nfrom shiny import App, render, ui\n\napp_ui = ui.page_fluid(\n    ui.output_text_verbatim(\"txt\", placeholder=True),\n    output_tabulator(\"tabulator\"),\n)\n\n\ndef server(input, output, session):\n    @render_tabulator\n    def tabulator():\n        df = pd.read_csv(\n            \"https://raw.githubusercontent.com/datasciencedojo/datasets/master/titanic.csv\"\n        )\n        return Tabulator(df, table_options=TableOptions(height=311))\n\n    @render.code\n    async def txt():\n        print(input.tabulator_row_clicked())\n        return str(input.tabulator_row_clicked())\n\n\napp = App(app_ui, server)\n```\n\nRun detailed example:\n\n```bash\nshiny run docs/examples/getting_started/shiny_express_all.py\n```\n\n![](docs/images/shiny-express-detailed-example.png)\n\n## Development\n\n### Python\n\n```bash\npoetry install\n\npoetry run pytest\n```\n\n### JavaScript\n\n```bash\nnpm install\n\nnpm run prettier\n\nnpm run build\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Shiny bindings for Tabulator JS",
    "version": "0.2.5",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "03e43fa503fb25520228d66eab06040ee5b49dab1ea78a77b48011dd41d0abdd",
                "md5": "9c7372ab9fb26001d8b87b2882df5726",
                "sha256": "59d2c215a4cdc964d1154c631ec5bb246d4d01db25a5c28beb5056dda76d58e7"
            },
            "downloads": -1,
            "filename": "pytabulator-0.2.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9c7372ab9fb26001d8b87b2882df5726",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 158544,
            "upload_time": "2024-09-06T06:52:19",
            "upload_time_iso_8601": "2024-09-06T06:52:19.963156Z",
            "url": "https://files.pythonhosted.org/packages/03/e4/3fa503fb25520228d66eab06040ee5b49dab1ea78a77b48011dd41d0abdd/pytabulator-0.2.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "94e1dd28dd0e0121ea40e08a89191b5da0ff8ef833e8969a6fd4ba5dcb45483a",
                "md5": "22672752688ca629aef45ed1e7770b33",
                "sha256": "aa48c27e37cafab004dd0547568c0061385f8b05a4b042e7f371da9857303977"
            },
            "downloads": -1,
            "filename": "pytabulator-0.2.5.tar.gz",
            "has_sig": false,
            "md5_digest": "22672752688ca629aef45ed1e7770b33",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 133148,
            "upload_time": "2024-09-06T06:52:22",
            "upload_time_iso_8601": "2024-09-06T06:52:22.211254Z",
            "url": "https://files.pythonhosted.org/packages/94/e1/dd28dd0e0121ea40e08a89191b5da0ff8ef833e8969a6fd4ba5dcb45483a/pytabulator-0.2.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-06 06:52:22",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pytabulator"
}
        
Elapsed time: 0.95480s