{"id":28761069,"url":"https://github.com/jwodder/curselect","last_synced_at":"2026-04-26T08:34:57.907Z","repository":{"id":296208154,"uuid":"992602174","full_name":"jwodder/curselect","owner":"jwodder","description":"TUI selection list forms","archived":false,"fork":false,"pushed_at":"2026-03-30T14:36:35.000Z","size":42,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-30T16:32:10.954Z","etag":null,"topics":["forms","python","terminal","tui","urwid"],"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/jwodder.png","metadata":{"files":{"readme":"README.rst","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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-29T12:23:30.000Z","updated_at":"2026-03-30T14:36:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"ec9f0246-dde7-45ff-922b-9786e48c1241","html_url":"https://github.com/jwodder/curselect","commit_stats":null,"previous_names":["jwodder/curselect"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jwodder/curselect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwodder%2Fcurselect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwodder%2Fcurselect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwodder%2Fcurselect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwodder%2Fcurselect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jwodder","download_url":"https://codeload.github.com/jwodder/curselect/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwodder%2Fcurselect/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32290814,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T08:29:33.829Z","status":"ssl_error","status_checked_at":"2026-04-26T08:29:18.366Z","response_time":129,"last_error":"SSL_read: 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":["forms","python","terminal","tui","urwid"],"created_at":"2025-06-17T06:39:41.178Z","updated_at":"2026-04-26T08:34:57.895Z","avatar_url":"https://github.com/jwodder.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"|repostatus| |ci-status| |license|\n\n.. |repostatus| image:: https://www.repostatus.org/badges/latest/concept.svg\n    :target: https://www.repostatus.org/#concept\n    :alt: Project Status: Concept – Minimal or no implementation has been done\n          yet, or the repository is only intended to be a limited example,\n          demo, or proof-of-concept.\n\n.. |ci-status| image:: https://github.com/jwodder/curselect/actions/workflows/test.yml/badge.svg\n    :target: https://github.com/jwodder/curselect/actions/workflows/test.yml\n    :alt: CI Status\n\n.. |license| image:: https://img.shields.io/github/license/jwodder/curselect.svg\n    :target: https://opensource.org/licenses/MIT\n    :alt: MIT License\n\n`GitHub \u003chttps://github.com/jwodder/curselect\u003e`_\n| `Issues \u003chttps://github.com/jwodder/curselect/issues\u003e`_\n\nThis is a crude Python library for presenting a user with a full-screen\nterminal interface consisting of a series of *selection lists* (radio buttons\nand sets of checkboxes) and capturing their choices.\n\nUsage, in brief:\n\n- Instantiate a ``Form``\n\n- Call ``form.add(field_name, selector)`` with each ``Selector`` or\n  ``MultiSelector`` you wish to present to the user\n\n  - For those fields that can be set on both ``Form`` and the selector classes,\n    leaving them unset/``None`` on a selector causes the selector to inherit\n    the value from the ``Form``.\n\n- Call ``form.run()`` to run the interface and get the user's selections\n\n  - This method returns a ``dict`` mapping field names to selections, or\n    ``None`` if the user cancelled\n  - The selection for a ``Selector`` is either the selected value or ``None``\n  - The selection for a ``MultiSelector`` is either a list of selected values\n    or (if none were selected *and* the ``defaults`` parameter was ``None``)\n    ``None``\n\nThe terminal interface supports the following keybindings:\n\n.. role:: kbd(literal)\n\n- :kbd:`j`, :kbd:`Down` — move down\n- :kbd:`k`, :kbd:`Up` — move up\n- :kbd:`h`, :kbd:`Left` — move left\n- :kbd:`l`, :kbd:`Right` — move right\n- :kbd:`w`, :kbd:`Page Up` — go up a page\n- :kbd:`z`, :kbd:`Page Down` — go down a page\n- :kbd:`g` — go to first item [#broken]_\n- :kbd:`G` — go to last item [#broken]_\n- :kbd:`Tab` — go to next selection list [#broken]_\n- :kbd:`Shift` + :kbd:`Tab` — go to previous selection list [#broken]_\n- :kbd:`Enter`, :kbd:`Space` — select/activate current selection\n- :kbd:`q`, :kbd:`Q` — cancel\n\n.. [#broken] Does not work correctly due to\n   https://github.com/urwid/urwid/issues/466\n\nInstallation\n============\n``curselect`` requires Python 3.10 or higher.  Just use `pip\n\u003chttps://pip.pypa.io\u003e`_ for Python 3 (You have pip, right?) to install it::\n\n    python3 -m pip install git+https://github.com/jwodder/curselect.git\n\n\nExample\n=======\n\n.. code:: python\n\n    import json\n    from curselect import Form, MultiSelector, Selector\n\n    form = Form()\n    form.add(\n        \"flavor\",\n        Selector(\n            \"Flavors:\",\n            [\n                \"Vanilla\",\n                \"Chocolate\",\n                \"Strawberry\",\n                \"Cinnamon\",\n                \"Butterscotch\",\n                \"Peanut Butter Fudge\",\n                \"Chili\",\n            ],\n            default=0,\n        ),\n    )\n    form.add(\n        \"toppings\",\n        MultiSelector(\n            \"Toppings:\",\n            [\n                \"Whipped Cream\",\n                \"Hot Fudge\",\n                \"Nuts\",\n                \"Cherry\",\n                \"Banana\",\n            ],\n        ),\n    )\n    selections = form.run()\n    print(json.dumps(selections, indent=4))\n\n.. image:: example.png\n    :alt: Example program in action\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwodder%2Fcurselect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwodder%2Fcurselect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwodder%2Fcurselect/lists"}