{"id":13501329,"url":"https://github.com/sirfuzzalot/textual-inputs","last_synced_at":"2025-03-29T08:32:21.336Z","repository":{"id":37885449,"uuid":"403843472","full_name":"sirfuzzalot/textual-inputs","owner":"sirfuzzalot","description":"Textual Inputs is a collection of input widgets for the Textual TUI framework 🔡","archived":false,"fork":false,"pushed_at":"2023-03-18T20:17:07.000Z","size":40,"stargazers_count":94,"open_issues_count":0,"forks_count":11,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-02T03:11:53.974Z","etag":null,"topics":["python","rich","terminal","textual","tui"],"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/sirfuzzalot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-09-07T04:48:21.000Z","updated_at":"2025-01-27T01:28:25.000Z","dependencies_parsed_at":"2024-01-16T10:36:13.110Z","dependency_job_id":"d7f2b502-f06b-43d9-a4f1-46e26589c0de","html_url":"https://github.com/sirfuzzalot/textual-inputs","commit_stats":{"total_commits":21,"total_committers":7,"mean_commits":3.0,"dds":"0.33333333333333337","last_synced_commit":"9ea34342d6964ce364e38cb35d8378ea6dca5d98"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sirfuzzalot%2Ftextual-inputs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sirfuzzalot%2Ftextual-inputs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sirfuzzalot%2Ftextual-inputs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sirfuzzalot%2Ftextual-inputs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sirfuzzalot","download_url":"https://codeload.github.com/sirfuzzalot/textual-inputs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246162092,"owners_count":20733351,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["python","rich","terminal","textual","tui"],"created_at":"2024-07-31T22:01:33.489Z","updated_at":"2025-03-29T08:32:19.697Z","avatar_url":"https://github.com/sirfuzzalot.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Textual Inputs 🔡\n\n[![Not Maintained](https://img.shields.io/badge/Maintenance%20Level-Abandoned-orange.svg)](https://gist.github.com/cheerfulstoic/d107229326a01ff0f333a1d3476e068d)\n[![Python Versions](https://shields.io/pypi/pyversions/textual-inputs)](https://www.python.org/downloads/)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat\u0026labelColor=ef8336)](https://pycqa.github.io/isort/)\n\nTextual Inputs is a collection of input widgets for the [Textual](https://github.com/willmcgugan/textual) TUI framework.\n\n## News\n\n### No Longer Maintained Due to Native Textual Support\n\nThanks to all the developers who contributed or used Textual Inputs. These widgets filled a gap in the early stages of Textual, which is now supported natively. Special thanks to @willmcgugan for creating this fun and functional framework -\u003e [Textual Widget Docs](https://textual.textualize.io/widgets/)\n\n## Quick Start\n\nInstallation\n\n```bash\npython -m pip install textual-inputs~=0.2.6\n```\n\nTo use Textual Inputs\n\n```python\nfrom textual_inputs import TextInput, IntegerInput\n```\n\nCheckout the [examples](https://github.com/sirfuzzalot/textual-inputs/tree/main/examples) for reference.\n\n```bash\ngit clone https://github.com/sirfuzzalot/textual-inputs.git\ncd textual-inputs\npython3 -m venv venv\nsource venv/bin/activate\npython -m pip install -e .\npython examples/simple_form.py\n```\n\n## Widgets\n\n### TextInput 🔡\n\n- value - string\n- one line of text with overflow support\n- placeholder and title support\n- password mode to hide input\n- syntax mode to highlight code\n- support for Unicode characters\n- controls: arrow right/left, home, end, delete, backspace/ctrl+h, escape\n- emits - InputOnChange, InputOnFocus messages\n\n### IntegerInput 🔢\n\n- value - integer or None\n- placeholder and title support\n- type a number or arrow up/down to increment/decrement the integer.\n- controls: arrow right/left, home, end, delete, backspace/ctrl+h, escape\n- emits - InputOnChange, InputOnFocus messages\n\n## Features\n\n### One-Line Syntax Highlighting\n\nTextual Inputs takes advantage of `rich`'s built-in Syntax feature. To\nadd highlighting to your input text set the `syntax` argument to a language\nsupported by `pygments`. Currently this is set to the default theme.\n\n**⚠️ THIS FEATURE IS LIMITED TO ONE LINE OF TEXT**\n\n```python\nTextInput(\n    name=\"code\",\n    placeholder=\"enter some python code...\",\n    title=\"Code\",\n    syntax=\"python\",\n)\n```\n\n### Event Handlers\n\nTextual Inputs helps make the event handler process easier by providing\nthe following convenient properties for inputs.\n\n- on_change_handler_name\n- on_focus_handler_name\n\n```python\nemail = TextInput(name=\"email\", title=\"Email\")\nemail.on_change_handler_name = \"handle_email_on_change\"\nemail.on_focus_handler_name = \"handle_email_on_focus\"\n```\n\nUnder the hood setting this attribute this will generate a `Message` class\nwith the appropriate name for Textual to send it to the handler name provided.\nYou'll then want add the handler to the input's parent or the App instance.\nIf you opt not to customize these handlers, their values will be the\ndefault `handle_input_on_change` and `handle_input_on_focus`. See\n`examples/simple_form.py` for a working example.\n\n## API Reference\n\nTextual Inputs has two widgets, here are their attributes.\n\n```python\nclass TextInput(Widget):\n    \"\"\"\n    A simple text input widget.\n\n    Args:\n        name (Optional[str]): The unique name of the widget. If None, the\n            widget will be automatically named.\n        value (str, optional): Defaults to \"\". The starting text value.\n        placeholder (str, optional): Defaults to \"\". Text that appears\n            in the widget when value is \"\" and the widget is not focused.\n        title (str, optional): Defaults to \"\". A title on the top left\n            of the widget's border.\n        password (bool, optional): Defaults to False. Hides the text\n            input, replacing it with bullets.\n        syntax (Optional[str]): the name of the language for syntax highlighting.\n\n    Attributes:\n        value (str): the value of the text field\n        placeholder (str): The placeholder message.\n        title (str): The displayed title of the widget.\n        has_password (bool): True if the text field masks the input.\n        syntax (Optional[str]): the name of the language for syntax highlighting.\n        has_focus (bool): True if the widget is focused.\n        cursor (Tuple[str, Style]): The character used for the cursor\n            and a rich Style object defining its appearance.\n        on_change_handler_name (str): name of handler function to be\n            called when an on change event occurs. Defaults to\n            handle_input_on_change.\n        on_focus_handler_name (name): name of handler function to be\n            called when an on focus event occurs. Defaults to\n            handle_input_on_focus.\n\n    Events:\n        InputOnChange: Emitted when the contents of the input changes.\n        InputOnFocus: Emitted when the widget becomes focused.\n\n    Examples:\n\n    .. code-block:: python\n\n        from textual_inputs import TextInput\n\n        email_input = TextInput(\n            name=\"email\",\n            placeholder=\"enter your email address...\",\n            title=\"Email\",\n        )\n\n    \"\"\"\n```\n\n```python\nclass IntegerInput(Widget):\n    \"\"\"\n    A simple integer input widget.\n\n    Args:\n        name (Optional[str]): The unique name of the widget. If None, the\n            widget will be automatically named.\n        value (Optional[int]): The starting integer value.\n        placeholder (Union[str, int, optional): Defaults to \"\". Text that\n            appears in the widget when value is \"\" and the widget is not focused.\n        title (str, optional): Defaults to \"\". A title on the top left\n            of the widget's border.\n\n    Attributes:\n        value (Union[int, None]): the value of the input field\n        placeholder (str): The placeholder message.\n        title (str): The displayed title of the widget.\n        has_focus (bool): True if the widget is focused.\n        cursor (Tuple[str, Style]): The character used for the cursor\n            and a rich Style object defining its appearance.\n        on_change_handler_name (str): name of handler function to be\n            called when an on change event occurs. Defaults to\n            handle_input_on_change.\n        on_focus_handler_name (name): name of handler function to be\n            called when an on focus event occurs. Defaults to\n            handle_input_on_focus.\n\n    Events:\n        InputOnChange: Emitted when the contents of the input changes.\n        InputOnFocus: Emitted when the widget becomes focused.\n\n    Examples:\n\n    .. code-block:: python\n\n        from textual_inputs import IntegerInput\n\n        age_input = IntegerInput(\n            name=\"age\",\n            placeholder=\"enter your age...\",\n            title=\"Age\",\n        )\n\n    \"\"\"\n```\n\n## Contributing\n\nSee the [Contributing Guide](https://github.com/sirfuzzalot/textual-inputs/blob/main/CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsirfuzzalot%2Ftextual-inputs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsirfuzzalot%2Ftextual-inputs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsirfuzzalot%2Ftextual-inputs/lists"}