Metadata-Version: 2.4
Name: shiny-treeview
Version: 0.1.0
Summary: A Shiny for Python extension providing a treeview component
Author-email: David Hall <david.hall.physics@gmail.com>
License: MIT License
        
        Copyright (c) 2025 David Hall
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/davidchall/shiny-treeview
Project-URL: Documentation, https://davidchall.github.io/shiny-treeview
Project-URL: Repository, https://github.com/davidchall/shiny-treeview.git
Project-URL: Bug Tracker, https://github.com/davidchall/shiny-treeview/issues
Keywords: shiny,python,treeview
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: User Interfaces
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: shiny>=0.6.0
Requires-Dist: htmltools>=0.6.0
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: playwright; extra == "test"
Requires-Dist: pytest-playwright; extra == "test"
Requires-Dist: pytest-playwright-visual-snapshot; extra == "test"
Provides-Extra: docs
Requires-Dist: quartodoc; extra == "docs"
Provides-Extra: dev
Requires-Dist: shiny-treeview[docs,test]; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Requires-Dist: isort; extra == "dev"
Dynamic: license-file

# Shiny TreeView

A TreeView UI component for [Shiny for Python](https://shiny.posit.co/py/), backed by [Material UI](https://mui.com/x/react-tree-view/).

## Installation

```sh
pip install shiny-treeview
```

To install the latest development version:

```sh
pip install git+https://github.com/davidchall/shiny-treeview.git#egg=shiny_treeview
```

## Quick Start

Create hierarchical data with `TreeItem`, add the treeview to your Shiny app UI, and use the selected IDs as needed in the rest of the app.

```python
from shiny import App, ui, render
from shiny_treeview import input_treeview, TreeItem

# Define your tree data using TreeItem objects
tree_data = [
    TreeItem(
        "docs",
        "📁 Documents",
        children=[
            TreeItem("report", "📄 Report.pdf"),
            TreeItem("slides", "📄 Slides.pptx"),
        ]
    ),
    TreeItem("readme", "ℹ️ README.md")
]

app_ui = ui.page_fluid(
    ui.h1("My Tree View App"),
    input_treeview("my_tree", tree_data),
    ui.output_text("selected_item")
)

def server(input, output, session):
    @render.text
    def selected_item():
        return f"Selected: {input.my_tree()}"

app = App(app_ui, server)
```
