{"id":18684775,"url":"https://github.com/j-sephb-lt-n/terminal-menu","last_synced_at":"2026-04-29T10:34:43.976Z","repository":{"id":227436961,"uuid":"771411426","full_name":"J-sephB-lt-n/terminal-menu","owner":"J-sephB-lt-n","description":"Create menus in terminal using Python (standard library)","archived":false,"fork":false,"pushed_at":"2024-03-27T20:25:41.000Z","size":1451,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-23T09:51:31.690Z","etag":null,"topics":["curses","menu","python","terminal"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/J-sephB-lt-n.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2024-03-13T08:53:58.000Z","updated_at":"2024-07-19T07:25:18.000Z","dependencies_parsed_at":"2024-03-16T14:55:54.890Z","dependency_job_id":"0bc87b10-cc2f-45ca-91b0-92b12e589329","html_url":"https://github.com/J-sephB-lt-n/terminal-menu","commit_stats":null,"previous_names":["j-sephb-lt-n/dynamic-python-terminal-menu"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/J-sephB-lt-n/terminal-menu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J-sephB-lt-n%2Fterminal-menu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J-sephB-lt-n%2Fterminal-menu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J-sephB-lt-n%2Fterminal-menu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J-sephB-lt-n%2Fterminal-menu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/J-sephB-lt-n","download_url":"https://codeload.github.com/J-sephB-lt-n/terminal-menu/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J-sephB-lt-n%2Fterminal-menu/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32422096,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T06:29:02.080Z","status":"ssl_error","status_checked_at":"2026-04-29T06:29:00.631Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["curses","menu","python","terminal"],"created_at":"2024-11-07T10:19:19.934Z","updated_at":"2026-04-29T10:34:43.951Z","avatar_url":"https://github.com/J-sephB-lt-n.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terminal Menu using Python \n\n[![Downloads](https://static.pepy.tech/badge/terminal-menu)](https://pepy.tech/project/terminal-menu)\n\n![](./examples/gifs/nested_menus.gif)\n\nHere is a minimal usage example:\n\n```python\nfrom terminal_menu import menu\nuser_choice: str = menu(\n    static_menu_text=\"Please choose an annoying little dog:\",\n    choices=(\"Chihuahua\", \"Pomeranian\", \"Jack Russell\"),\n)\nprint(f\"user chose '{user_choice}'\")\n```\n\n![](./examples/gifs/basic_menu.gif)\n\nI wanted a simple OS-agnostic interface for creating menus in my python command-line applications (using only the python standard library). \n\nI could not find one that I liked, so I built this one. \n\nIt is not truly operating system agnostic since it uses the [curses](https://docs.python.org/3/library/curses.html#module-curses) python library, which will not work on a Windows terminal. It works on WSL though.\n\nI purposely contained all of the functionality in a single script ([terminal_menu.py](./terminal_menu.py)) so that this function can be easily included in a project with a minimal footprint. If you don't mind your project looking like a NodeJS project, you can also install it as a package from [PyPI](https://pypi.org/project/terminal-menu/):\n\n```bash\npip install terminal-menu\n```\n\nHere is a more complex usage example ([examples/nested_menus.py](./examples/nested_menus.py)):\n\n![](./examples/gifs/nested_menus.gif)\n\n```python\nfrom terminal_menu import menu\n\nsound_status: str = \"On\"\nvideo_quality: str = \"Low\"\npersist_menu: bool = True\nwhile persist_menu:\n    user_choice: str = menu(\n        static_menu_text=\"-- MAIN MENU --\", choices=(\"New Game\", \"Options\", \"Exit\")\n    )\n    if user_choice == \"Exit\":\n        break\n    elif user_choice == \"New Game\":\n        user_choice = menu(\n            static_menu_text=\"-- NEW GAME --\",\n            choices=(\"Single Player\", \"Multiplayer\", \"Back to Main Menu\"),\n        )\n        if user_choice in (\"Single Player\", \"Multiplayer\"):\n            print(f\"User started new {user_choice} game\")\n            persist_menu = False\n    elif user_choice == \"Options\":\n        persist_options_menu: bool = True\n        while persist_options_menu:\n            user_choice = menu(\n                static_menu_text=f\"\"\"-- OPTIONS --\nSound is currently {sound_status}\nVideo quality is currently {video_quality}\n\"\"\",\n                choices=(\"Sound\", \"Video\", \"Back to Main Menu\"),\n            )\n            if user_choice == \"Back to Main Menu\":\n                persist_options_menu = False\n            elif user_choice == \"Sound\":\n                user_choice = menu(\n                    static_menu_text=\"-- SOUND OPTIONS --\",\n                    choices=(\"Off\", \"On\", \"Back to Options\"),\n                )\n                if user_choice in (\"Off\", \"On\"):\n                    sound_status = user_choice\n            elif user_choice == \"Video\":\n                user_choice = menu(\n                    static_menu_text=\"-- VIDEO OPTIONS --\",\n                    choices=(\"Low\", \"Medium\", \"High\", \"Back to Options\"),\n                )\n                if user_choice in (\"Low\", \"Medium\", \"High\"):\n                    video_quality = user_choice\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj-sephb-lt-n%2Fterminal-menu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fj-sephb-lt-n%2Fterminal-menu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj-sephb-lt-n%2Fterminal-menu/lists"}