gradio-path-selector


Namegradio-path-selector JSON
Version 0.1.3 PyPI version JSON
download
home_pageNone
SummaryA path Selector component for Gradio
upload_time2024-10-02 14:56:37
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords gradio-custom-component gradio-template-fallback
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ---
tags: [gradio-path-selector, ]
title: gradio_path_selector
short_description: A gradio Path Selector
colorFrom: blue
colorTo: yellow
sdk: gradio
pinned: false
app_file: space.py
---

# `gradio_path_selector`
<a href="https://pypi.org/project/gradio_path_selector/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_path_selector"></a> <a href="https://github.com/ncassereau-idris/gradio_path_selector/issues" target="_blank"><img alt="Static Badge" src="https://img.shields.io/badge/Issues-white?logo=github&logoColor=black"></a> 

A path Selector component for Gradio

## Installation

```bash
pip install gradio_path_selector
```

## Build from source

```bash
git clone https://github.com/ncassereau-idris/gradio_path_selector
cd gradio_path_selector
make build
pip install dist/gradio_path_selector-*-py3-none-any.whl
```

## Usage

```python
import gradio as gr

from gradio_path_selector import PathSelector


with gr.Blocks() as demo:
    PathSelector()

if __name__ == "__main__":
    demo.launch()

```

## `PathSelector`

### Initialization

<table>
<thead>
<tr>
<th align="left">name</th>
<th align="left" style="width: 25%;">type</th>
<th align="left">default</th>
<th align="left">description</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left"><code>value</code></td>
<td align="left" style="width: 25%;">

```python
str | Callable | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">default text to provide in textbox. If callable, the function will be called whenever the app loads to set the initial value of the component.</td>
</tr>

<tr>
<td align="left"><code>placeholder</code></td>
<td align="left" style="width: 25%;">

```python
str | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">placeholder hint to provide behind textbox.</td>
</tr>

<tr>
<td align="left"><code>label</code></td>
<td align="left" style="width: 25%;">

```python
str | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">component name in interface.</td>
</tr>

<tr>
<td align="left"><code>every</code></td>
<td align="left" style="width: 25%;">

```python
Timer | float | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">Continously calls `value` to recalculate it if `value` is a function (has no effect otherwise). Can provide a Timer whose tick resets `value`, or a float that provides the regular interval for the reset Timer.</td>
</tr>

<tr>
<td align="left"><code>show_label</code></td>
<td align="left" style="width: 25%;">

```python
bool | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">if True, will display label.</td>
</tr>

<tr>
<td align="left"><code>scale</code></td>
<td align="left" style="width: 25%;">

```python
int | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.</td>
</tr>

<tr>
<td align="left"><code>min_width</code></td>
<td align="left" style="width: 25%;">

```python
int
```

</td>
<td align="left"><code>160</code></td>
<td align="left">minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.</td>
</tr>

<tr>
<td align="left"><code>visible</code></td>
<td align="left" style="width: 25%;">

```python
bool
```

</td>
<td align="left"><code>True</code></td>
<td align="left">If False, component will be hidden.</td>
</tr>

<tr>
<td align="left"><code>elem_id</code></td>
<td align="left" style="width: 25%;">

```python
str | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.</td>
</tr>

<tr>
<td align="left"><code>elem_classes</code></td>
<td align="left" style="width: 25%;">

```python
list[str] | str | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.</td>
</tr>

<tr>
<td align="left"><code>render</code></td>
<td align="left" style="width: 25%;">

```python
bool
```

</td>
<td align="left"><code>True</code></td>
<td align="left">If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.</td>
</tr>

<tr>
<td align="left"><code>key</code></td>
<td align="left" style="width: 25%;">

```python
int | str | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">if assigned, will be used to assume identity across a re-render. Components that have the same key across a re-render will have their value preserved.</td>
</tr>
</tbody></table>


### Events

| name | description |
|:-----|:------------|
| `change` | Triggered when the value of the PathSelector changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). See `.input()` for a listener that is only triggered by user input. |




            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "gradio-path-selector",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "gradio-custom-component, gradio-template-Fallback",
    "author": null,
    "author_email": "Nathan Cassereau <nathan.cassereau@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/4e/89/4220c2487d844cf65616847c610516e297279f29f113183b6594d1998e9d/gradio_path_selector-0.1.3.tar.gz",
    "platform": null,
    "description": "---\ntags: [gradio-path-selector, ]\ntitle: gradio_path_selector\nshort_description: A gradio Path Selector\ncolorFrom: blue\ncolorTo: yellow\nsdk: gradio\npinned: false\napp_file: space.py\n---\n\n# `gradio_path_selector`\n<a href=\"https://pypi.org/project/gradio_path_selector/\" target=\"_blank\"><img alt=\"PyPI - Version\" src=\"https://img.shields.io/pypi/v/gradio_path_selector\"></a> <a href=\"https://github.com/ncassereau-idris/gradio_path_selector/issues\" target=\"_blank\"><img alt=\"Static Badge\" src=\"https://img.shields.io/badge/Issues-white?logo=github&logoColor=black\"></a> \n\nA path Selector component for Gradio\n\n## Installation\n\n```bash\npip install gradio_path_selector\n```\n\n## Build from source\n\n```bash\ngit clone https://github.com/ncassereau-idris/gradio_path_selector\ncd gradio_path_selector\nmake build\npip install dist/gradio_path_selector-*-py3-none-any.whl\n```\n\n## Usage\n\n```python\nimport gradio as gr\n\nfrom gradio_path_selector import PathSelector\n\n\nwith gr.Blocks() as demo:\n    PathSelector()\n\nif __name__ == \"__main__\":\n    demo.launch()\n\n```\n\n## `PathSelector`\n\n### Initialization\n\n<table>\n<thead>\n<tr>\n<th align=\"left\">name</th>\n<th align=\"left\" style=\"width: 25%;\">type</th>\n<th align=\"left\">default</th>\n<th align=\"left\">description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td align=\"left\"><code>value</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nstr | Callable | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">default text to provide in textbox. If callable, the function will be called whenever the app loads to set the initial value of the component.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>placeholder</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nstr | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">placeholder hint to provide behind textbox.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>label</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nstr | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">component name in interface.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>every</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nTimer | float | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">Continously calls `value` to recalculate it if `value` is a function (has no effect otherwise). Can provide a Timer whose tick resets `value`, or a float that provides the regular interval for the reset Timer.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>show_label</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nbool | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">if True, will display label.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>scale</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nint | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>min_width</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nint\n```\n\n</td>\n<td align=\"left\"><code>160</code></td>\n<td align=\"left\">minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>visible</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nbool\n```\n\n</td>\n<td align=\"left\"><code>True</code></td>\n<td align=\"left\">If False, component will be hidden.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>elem_id</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nstr | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>elem_classes</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nlist[str] | str | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>render</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nbool\n```\n\n</td>\n<td align=\"left\"><code>True</code></td>\n<td align=\"left\">If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>key</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nint | str | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">if assigned, will be used to assume identity across a re-render. Components that have the same key across a re-render will have their value preserved.</td>\n</tr>\n</tbody></table>\n\n\n### Events\n\n| name | description |\n|:-----|:------------|\n| `change` | Triggered when the value of the PathSelector changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). See `.input()` for a listener that is only triggered by user input. |\n\n\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A path Selector component for Gradio",
    "version": "0.1.3",
    "project_urls": {
        "repository": "https://github.com/ncassereau-idris/gradio_path_selector"
    },
    "split_keywords": [
        "gradio-custom-component",
        " gradio-template-fallback"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "655fa4e8123c64f68a23d42348c9f5491b11beb5089c008990035045ac1e78c7",
                "md5": "f6e88c676581d97da1b5ce53dc7b37d8",
                "sha256": "c7f08e3e8e396372d93625759fe8b306e98e3f629874b8480f7754983f2a7701"
            },
            "downloads": -1,
            "filename": "gradio_path_selector-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f6e88c676581d97da1b5ce53dc7b37d8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 41962,
            "upload_time": "2024-10-02T14:56:36",
            "upload_time_iso_8601": "2024-10-02T14:56:36.412434Z",
            "url": "https://files.pythonhosted.org/packages/65/5f/a4e8123c64f68a23d42348c9f5491b11beb5089c008990035045ac1e78c7/gradio_path_selector-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4e894220c2487d844cf65616847c610516e297279f29f113183b6594d1998e9d",
                "md5": "49dd5c81d9846886b6338d0c4d760a37",
                "sha256": "9507e00318586ec751da1754152a3fb3a028e6b482eaa92cac3b3dff1e90c0e8"
            },
            "downloads": -1,
            "filename": "gradio_path_selector-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "49dd5c81d9846886b6338d0c4d760a37",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 83163,
            "upload_time": "2024-10-02T14:56:37",
            "upload_time_iso_8601": "2024-10-02T14:56:37.992245Z",
            "url": "https://files.pythonhosted.org/packages/4e/89/4220c2487d844cf65616847c610516e297279f29f113183b6594d1998e9d/gradio_path_selector-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-02 14:56:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ncassereau-idris",
    "github_project": "gradio_path_selector",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "gradio-path-selector"
}
        
Elapsed time: 2.87711s