{"id":28546330,"url":"https://github.com/astrowonk/shiny_tables","last_synced_at":"2026-04-28T01:33:21.861Z","repository":{"id":189344565,"uuid":"680511581","full_name":"astrowonk/shiny_tables","owner":"astrowonk","description":"Bootstrap Tables from Dataframes for Shiny for Python","archived":false,"fork":false,"pushed_at":"2024-01-30T13:01:06.000Z","size":42,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-07T06:43:34.751Z","etag":null,"topics":["bootstrap","dataframes","shiny","shiny-py","shiny-python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/astrowonk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-19T13:37:48.000Z","updated_at":"2024-05-29T15:43:34.000Z","dependencies_parsed_at":"2023-08-19T14:47:44.274Z","dependency_job_id":"2f7c4f28-d01c-48dd-a5ae-2872c8457f13","html_url":"https://github.com/astrowonk/shiny_tables","commit_stats":{"total_commits":27,"total_committers":1,"mean_commits":27.0,"dds":0.0,"last_synced_commit":"76d40b7f978f617c25e951b44c068ed2d95197f9"},"previous_names":["astrowonk/shiny_tables"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/astrowonk/shiny_tables","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrowonk%2Fshiny_tables","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrowonk%2Fshiny_tables/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrowonk%2Fshiny_tables/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrowonk%2Fshiny_tables/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/astrowonk","download_url":"https://codeload.github.com/astrowonk/shiny_tables/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrowonk%2Fshiny_tables/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32362781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bootstrap","dataframes","shiny","shiny-py","shiny-python"],"created_at":"2025-06-09T23:38:55.615Z","updated_at":"2026-04-28T01:33:21.849Z","avatar_url":"https://github.com/astrowonk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Bootstrap tables from DataFrames\n\nA very early rough implementation for Python Shiny of my [Dash Dataframe Tables package](https://github.com/astrowonk/dash_dataframe_table). [See A Live Demo App Here.](https://marcoshuerta.com/shiny/shiny_tables/)\n\n## Features\n\nThis `enhanced_from_dataframe` function creates bootstrap tables with some automatic features like links and conditional formatting.\n\n* **Automatic Links** It will automatically generate `ui.tags.A` wrappers around a column from a __matched column in the same dataframe__.  The hyperlink column must match the column_name + a specific suffix. In the example to the right, the (hidden) link column is `Company_HREF`, using the default suffix.\n* **Conditional Formatting** Criteria can either be a list of tuples `(match_list,style_dict)` or a `callable` that returns the style dict if the condition is met. This allows for more complex condition formatting.\n* **Any Callable can wrap a cell** Pass a callable to the function to customize the content of any column. Turn it into a button, link, wrap it in any UI elements you can create in Shiny.\n\n## How to use\nThis is invoked with render.ui and outputting to a ui output:\n\n```python\n        \ndef server(input, output, session):\n\n    @output\n    @render.ui\n    def result():\n        return enhanced_from_dataframe(\n            df,\n            markdown_columns=['markdown_example'],\n            cell_style_dict=cell_style_dict,\n            columns=['Company', 'Date', 'Value', 'Value2', 'markdown_example'])\n\n\n```\n\n\nThe code below generates the conditional formatting you see. You can also add a specific bootstrap class by putting a `class` key in the \"style\" dictionary.\n\n```python\n\ndef color_positive(val):\n    if val \u003e 0:\n        return {'class': 'table-success'}\n    elif val \u003c 0:\n        return {'class': \"table-danger\"}\n\n\ncell_style_dict = {\n    'Company': [\n        (['Yahoo', 'Apple'], {\n            \"style\": 'font-weight: bold'\n        }),\n        (['Oracle'], {\n            'class': 'table-danger'\n        }),\n    ],\n    'Value2':\n    lambda x: {\n        \"style\": 'background-color: #7FFFD4'\n    } if x \u003e 10 else {\n    }\n    'Date':\n    lambda x: {\n        'class': 'table-info'\n    } if x.weekday() in [4, 6] else {},\n    'Value':\n    color_positive\n}\n```\n\nThis code has a callable wrapper for the Company2 column:\n\n```python\n\ndef wrap_company(row, col_name):\n    return experimental.ui.tooltip(\n        ui.tags.button(row[col_name], ),\n        f\"This is a tool tip for {row[col_name]} that shows the link {row['Company_HREF']}\"\n    )\n\n\n\n```\n\n\n\u003cimg width=\"704\" alt=\"Screenshot 2023-08-19 at 7 56 56 PM\" src=\"https://github.com/astrowonk/shiny_tables/assets/13702392/1beb0669-4d65-4640-aa27-ede19a2f4d44\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrowonk%2Fshiny_tables","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastrowonk%2Fshiny_tables","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrowonk%2Fshiny_tables/lists"}