{"id":30558394,"url":"https://github.com/petereon/beaupy","last_synced_at":"2025-08-28T08:29:30.277Z","repository":{"id":56715411,"uuid":"522041298","full_name":"petereon/beaupy","owner":"petereon","description":"A Python library of interactive CLI elements you have been looking for","archived":false,"fork":false,"pushed_at":"2025-07-31T09:51:01.000Z","size":15454,"stargazers_count":223,"open_issues_count":14,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-19T03:50:24.307Z","etag":null,"topics":["cli","console","interface","python","terminal"],"latest_commit_sha":null,"homepage":"https://petereon.github.io/beaupy/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"Kamik423/cutie","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/petereon.png","metadata":{"files":{"readme":"README.md","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}},"created_at":"2022-08-06T19:56:01.000Z","updated_at":"2025-07-18T12:54:59.000Z","dependencies_parsed_at":"2023-12-27T09:24:55.222Z","dependency_job_id":"f80c15fa-3f41-4540-ba65-0b86e10ce667","html_url":"https://github.com/petereon/beaupy","commit_stats":{"total_commits":323,"total_committers":14,"mean_commits":"23.071428571428573","dds":0.4179566563467493,"last_synced_commit":"2892eda14783dd572b1cfeb49367fe9371135a61"},"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"purl":"pkg:github/petereon/beaupy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petereon%2Fbeaupy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petereon%2Fbeaupy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petereon%2Fbeaupy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petereon%2Fbeaupy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/petereon","download_url":"https://codeload.github.com/petereon/beaupy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petereon%2Fbeaupy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272469996,"owners_count":24939926,"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","status":"online","status_checked_at":"2025-08-28T02:00:10.768Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cli","console","interface","python","terminal"],"created_at":"2025-08-28T08:29:29.543Z","updated_at":"2025-08-28T08:29:30.269Z","avatar_url":"https://github.com/petereon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BeauPy\n\n![beaupy](https://user-images.githubusercontent.com/47027005/185082011-cb588f57-d38f-42d8-8312-3981ae1bc479.png)\n\n\u003e A Python library of interactive CLI elements you have been looking for\n\n---\n\n[![CI](https://github.com/petereon/beaupy/actions/workflows/python-test.yml/badge.svg)](https://github.com/petereon/beaupy/actions/workflows/python-test.yml)\n[![codecov](https://codecov.io/gh/petereon/beaupy/branch/master/graph/badge.svg?token=HSG6MGTXBC)](https://codecov.io/gh/petereon/beaupy)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=petereon_beaupy\u0026metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=petereon_beaupy)\n[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=petereon_beaupy\u0026metric=security_rating)](https://sonarcloud.io/summary/new_code?id=petereon_beaupy)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/beaupy?color=g\u0026label=%F0%9F%93%A5%20Downloads)\n\n![example](https://raw.githubusercontent.com/petereon/beaupy/master/example.gif)\n\nFor documentation but more and prettier see [**here**](https://petereon.github.io/beaupy/)\n\n## Acknowledgment\n\nBeauPy stands on the shoulders of giants. It is based on another library with which it shares some of the source code, [`cutie`](https://github.com/kamik423/cutie), developed by [Kamik423](https://github.com/Kamik423). It has begun as a fork but has since diverged into its own thing and as such, detached from the original repository.\n\n## Overview\n\n**BeauPy** implements a number of common interactive elements:\n\n| Function                                                                         | Functionality                                                                              |\n|:---------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------|\n| [`select`](https://petereon.github.io/beaupy/api/#select)                        | Prompt to pick a choice from a list                                                        |\n| [`select_multiple`](https://petereon.github.io/beaupy/api/#select_multiple)      | Prompt to select one or multiple choices from a list                                       |\n| [`confirm`](https://petereon.github.io/beaupy/api/#confirm)                      | Prompt with a question and yes/no options                                                  |\n| [`prompt`](https://petereon.github.io/beaupy/api/#prompt)                        | Prompt that takes free input with optional validation, type conversion and input hiding    |\n\nTUI elements shown in the above gif are the result of the following code:\n\n```python\nimport time\nfrom beaupy import confirm, prompt, select, select_multiple\nfrom beaupy.spinners import *\nfrom rich.console import Console\n\nconsole = Console()\n\n# Confirm a dialog\nif confirm(\"Will you take the ring to Mordor?\"):\n    names = [\n        \"Frodo Baggins\",\n        \"Samwise Gamgee\",\n        \"Legolas\",\n        \"Aragorn\",\n        \"[red]Sauron[/red]\",\n    ]\n    console.print(\"Who are you?\")\n    # Choose one item from a list\n    name = select(names, cursor=\"🢧\", cursor_style=\"cyan\")\n    console.print(f\"Alámenë, {name}\")\n\n\n    item_options = [\n        \"The One Ring\",\n        \"Dagger\",\n        \"Po-tae-toes\",\n        \"Lightsaber (Wrong franchise! Nevermind, roll with it!)\",\n    ]\n    console.print(\"What do you bring with you?\")\n    # Choose multiple options from a list\n    items = select_multiple(item_options, tick_character='🎒', ticked_indices=[0], maximal_count=3)\n\n    potato_count = 0\n    if \"Po-tae-toes\" in items:\n        # Prompt with type conversion and validation\n        potato_count = prompt('How many potatoes?', target_type=int, validator=lambda count: count \u003e 0)\n\n    # Spinner to show while doing some work\n    spinner = Spinner(DOTS, \"Packing things...\")\n    spinner.start()\n\n    time.sleep(2)\n\n    spinner.stop()\n    # Get input without showing it being typed\n    if \"friend\" == prompt(\"Speak, [blue bold underline]friend[/blue bold underline], and enter\", secure=True).lower():\n\n        # Custom spinner animation\n        spinner_animation = ['▉▉', '▌▐', '  ', '▌▐', '▉▉']\n        spinner = Spinner(spinner_animation, \"Opening the Door of Durin...\")\n        spinner.start()\n\n        time.sleep(2)\n\n        spinner.stop()\n    else:\n        spinner_animation = ['🐙🌊    ⚔️ ', '🐙 🌊   ⚔️ ', '🐙  🌊  ⚔️ ', '🐙   🌊 ⚔️ ', '🐙    🌊⚔️ ']\n        spinner = Spinner(spinner_animation, \"Getting attacked by an octopus...\")\n        spinner.start()\n\n        time.sleep(2)\n\n        spinner.stop()\n\n    if 'The One Ring' in items:\n        console.print(\"[green]You throw The One Ring to a lava from an eagle![/green]\")\n    else:\n        console.print(\"[red]You forgot the ring and brought Middle-Earth to its knees![/red]\")\n    console.print(f\"And you brought {potato_count} taters!\")\n```\n\nFor more information refer to [more examples](https://petereon.github.io/beaupy/examples/) or definitive, but much less exciting [API documentation](https://petereon.github.io/beaupy/api/)\n\n## Installation\n\nFrom PyPI:\n\n```sh\npip install beaupy\n```\n\nFrom [Conda](https://github.com/conda-forge/beaupy-feedstock) (kindly set up and maintained by [@thewchan](https://github.com/thewchan)):\n\n```sh\nconda config --add channels conda-forge\nconda config --set channel_priority strict\nconda install beaupy\n```\n\nFrom source:\n\n```sh\ngit clone https://github.com/petereon/beaupy.git\npoetry build\npip install ./dist/beaupy-{{some-version}}-py3-none-any.whl\n```\n\n## Roadmap\n\nThis repository has a [associated GitHub project](https://github.com/users/petereon/projects/3/views/1) where work that is currently done can be seen.\n\n## Contributing\n\nIf you would like to contribute, please feel free to suggest features or implement them yourself.\n\nAlso **please report any issues and bugs you might find!**\n\n### Development\n\nTo start development you can clone the repository:\n\n```sh\ngit clone https://github.com/petereon/beaupy.git\n```\n\nChange the directory to the project directory:\n\n```sh\ncd ./beaupy/\n```\n\nThis project uses [`poetry`](https://python-poetry.org/) as a dependency manager. You can install the dependencies using:\n\n```sh\npoetry install\n```\n\nFor testing, this project relies on pytest. It is included as a development dependency, so\nafter installing the dependencies you can simply execute the following:\n\n```sh\npoetry run poe test\n```\n\nMaking sure the code follows quality standards and formatting can be ensured by executing\n\n```sh\npoetry run poe lint\n```\n\nYou can also have the tests and lints run after every saved change by executing a respective watch command\n\n```sh\npoetry run poe test:watch\n```\n\nor\n\n```sh\npoetry run poe lint:watch\n```\n\nAfter you have made your changes, create a pull request towards a master branch of this repository\n\nLooking forward to your pull requests!\n\n## Compatibility\n\nInternal logic of `beaupy` is supported for all the major platforms (Windows, Linux, macOS).\n\n- For user input from console, `beaupy` relies on [petereon/yakh](https://github.com/petereon/yakh), which is tested against all the major platforms and Python versions.\n- For printing to console `beaupy` relies on [Textualize/rich](https://github.com/Textualize/rich), which [supports](https://github.com/Textualize/rich#compatibility) all the major platforms.\n\n## Known Issues\n\n- From version `0.1.7` the CLI elements cause issue with displaying `pdb` prompt ([#93](https://github.com/petereon/beaupy/issues/93)).\n- From version `2.0.0` arrow keys reportedly don't always work on Windows. Resolved in `3.0.0`.\n- From version `3.5.0` there were various option display bugs in `select` and `select_multiple`. Resolved in `3.5.4`.\n- From version `3.9.0`, the CLI elements default to persisting in the terminal after they finish executing. Resolved in `3.9.2`.\n\n## Awesome projects using `beaupy`\n\n- [therealOri/Genter](https://github.com/therealOri/Genter): A strong password generator and built in password manager made with python3!\n- [therealOri/byte](https://github.com/therealOri/byte): Steganography Image/Data Injector. For artists or people to inject their own Datamark \"Watermark\" into their images/art or files!\n- [AnirudhG07/ntfyme](https://github.com/AnirudhG07/ntfyme): A notification tool to notify you about status of your long running processes on termination via local-notification, Gmail, Telergram, etc.\n\n## License\n\nThe project is licensed under the [MIT License](https://raw.githubusercontent.com/petereon/beaupy/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetereon%2Fbeaupy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpetereon%2Fbeaupy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetereon%2Fbeaupy/lists"}