streamlit-input-box


Namestreamlit-input-box JSON
Version 0.0.3 PyPI version JSON
download
home_pagehttps://github.com/B4PT0R/streamlit_input_box
SummaryStreamlit component that allows you to edit text/code in a convenient text area.
upload_time2024-01-14 21:31:45
maintainer
docs_urlNone
authorBaptiste Ferrand
requires_python>=3.7
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # streamlit-input-box

Streamlit component that allows you to edit text/code in a convenient auto-resizable text area.
Intended both for code and natural language input (no syntax highlighting implemented).
No text wrap and horizontal scrolling makes code editing easier.
It's state resets to empty automatically after submiting.
Manages its own history of inputs that can be navigated using Ctrl+up / Ctrl+down.
Colors adapt dynamically to the app's theme.

## Installation instructions

```sh
pip install streamlit-input-box
```

## Usage instructions

Pretty straighforward.

```python
text=input_box(
    min_lines=1,
    max_lines=5,
    just_once=False,
    callback=None,
    args=(),
    kwargs={},
    key=None
)
```
Renders an auto-resizable text area. 
Enter and Tab keystrokes behave as expected for text edition.
Ctrl+Enter or click the 'send' button to submit.
Returns the inputted text.

Arguments:
- min/max_lines: minimal and maximal limits for auto-resizing of the input box.
- just_once: determines if the component will return the text only once after submiting (and then None), or on every rerun of the app.
- callback: optional callback passed to the component that will be called after submitting.
- args: optional tuple of arguments passed to the callback
- kwargs: optional dict of named arguments passed to the callback
- key: unique state identifier for your component 

## Example

```python
import streamlit as st
from streamlit_input_box import input_box

state=st.session_state

if 'texts' not in state:
    state.texts=[]

text=input_box(min_lines=3,max_lines=10,just_once=True)
    
if text:
    state.texts.append(text)

for text in state.texts:
    st.text(text)
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/B4PT0R/streamlit_input_box",
    "name": "streamlit-input-box",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "Baptiste Ferrand",
    "author_email": "bferrand.maths@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/99/25/7ea89335587ea11158e946e68ab442c77152aeff5d79bb74ff5375d297cb/streamlit_input_box-0.0.3.tar.gz",
    "platform": null,
    "description": "# streamlit-input-box\n\nStreamlit component that allows you to edit text/code in a convenient auto-resizable text area.\nIntended both for code and natural language input (no syntax highlighting implemented).\nNo text wrap and horizontal scrolling makes code editing easier.\nIt's state resets to empty automatically after submiting.\nManages its own history of inputs that can be navigated using Ctrl+up / Ctrl+down.\nColors adapt dynamically to the app's theme.\n\n## Installation instructions\n\n```sh\npip install streamlit-input-box\n```\n\n## Usage instructions\n\nPretty straighforward.\n\n```python\ntext=input_box(\n    min_lines=1,\n    max_lines=5,\n    just_once=False,\n    callback=None,\n    args=(),\n    kwargs={},\n    key=None\n)\n```\nRenders an auto-resizable text area. \nEnter and Tab keystrokes behave as expected for text edition.\nCtrl+Enter or click the 'send' button to submit.\nReturns the inputted text.\n\nArguments:\n- min/max_lines: minimal and maximal limits for auto-resizing of the input box.\n- just_once: determines if the component will return the text only once after submiting (and then None), or on every rerun of the app.\n- callback: optional callback passed to the component that will be called after submitting.\n- args: optional tuple of arguments passed to the callback\n- kwargs: optional dict of named arguments passed to the callback\n- key: unique state identifier for your component \n\n## Example\n\n```python\nimport streamlit as st\nfrom streamlit_input_box import input_box\n\nstate=st.session_state\n\nif 'texts' not in state:\n    state.texts=[]\n\ntext=input_box(min_lines=3,max_lines=10,just_once=True)\n    \nif text:\n    state.texts.append(text)\n\nfor text in state.texts:\n    st.text(text)\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Streamlit component that allows you to edit text/code in a convenient text area.",
    "version": "0.0.3",
    "project_urls": {
        "Homepage": "https://github.com/B4PT0R/streamlit_input_box"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d865f2d05b9014f2ce6f0682f3b4bd46d4897ddfe9f8a74b7f53af664b3abbf4",
                "md5": "a43fe77e88279037a59b406048f6cc99",
                "sha256": "2f2a66d5d9dcaf4dbc5a594a739e9a35984689e9d897fd9809e3670ff7ce43f3"
            },
            "downloads": -1,
            "filename": "streamlit_input_box-0.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a43fe77e88279037a59b406048f6cc99",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 998541,
            "upload_time": "2024-01-14T21:31:42",
            "upload_time_iso_8601": "2024-01-14T21:31:42.621169Z",
            "url": "https://files.pythonhosted.org/packages/d8/65/f2d05b9014f2ce6f0682f3b4bd46d4897ddfe9f8a74b7f53af664b3abbf4/streamlit_input_box-0.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "99257ea89335587ea11158e946e68ab442c77152aeff5d79bb74ff5375d297cb",
                "md5": "23f9aa1ec7da468195d0d91d64cdadcf",
                "sha256": "5cc61e231939bb651ed26ed70e634721febc30ddd8cc4d566bc36eaaa52f44f7"
            },
            "downloads": -1,
            "filename": "streamlit_input_box-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "23f9aa1ec7da468195d0d91d64cdadcf",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 996413,
            "upload_time": "2024-01-14T21:31:45",
            "upload_time_iso_8601": "2024-01-14T21:31:45.171738Z",
            "url": "https://files.pythonhosted.org/packages/99/25/7ea89335587ea11158e946e68ab442c77152aeff5d79bb74ff5375d297cb/streamlit_input_box-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-14 21:31:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "B4PT0R",
    "github_project": "streamlit_input_box",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "streamlit-input-box"
}
        
Elapsed time: 0.17841s