{"id":20390257,"url":"https://github.com/nonebot/noneprompt","last_synced_at":"2025-04-23T18:08:42.617Z","repository":{"id":37399905,"uuid":"505695377","full_name":"nonebot/noneprompt","owner":"nonebot","description":"Prompt toolkit for console interaction (support async, typing)","archived":false,"fork":false,"pushed_at":"2025-03-04T11:46:27.000Z","size":106,"stargazers_count":28,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-23T18:08:36.612Z","etag":null,"topics":["inquirer","prompt","prompt-toolkit","python-inquirer"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/noneprompt/","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/nonebot.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},"funding":{"open_collective":"nonebot","custom":["https://afdian.com/@nonebot"]}},"created_at":"2022-06-21T04:57:48.000Z","updated_at":"2025-04-07T16:28:16.000Z","dependencies_parsed_at":"2023-10-16T03:29:35.107Z","dependency_job_id":"61d2ff00-20db-4a55-b16a-5c226adc7630","html_url":"https://github.com/nonebot/noneprompt","commit_stats":{"total_commits":54,"total_committers":3,"mean_commits":18.0,"dds":"0.33333333333333337","last_synced_commit":"11edca1f32b9532341911d340f87dee25923a6ef"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nonebot%2Fnoneprompt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nonebot%2Fnoneprompt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nonebot%2Fnoneprompt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nonebot%2Fnoneprompt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nonebot","download_url":"https://codeload.github.com/nonebot/noneprompt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250487528,"owners_count":21438612,"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":["inquirer","prompt","prompt-toolkit","python-inquirer"],"created_at":"2024-11-15T03:23:54.489Z","updated_at":"2025-04-23T18:08:42.597Z","avatar_url":"https://github.com/nonebot.png","language":"Python","funding_links":["https://opencollective.com/nonebot","https://afdian.com/@nonebot"],"categories":[],"sub_categories":[],"readme":"# NonePrompt\n\nPrompt toolkit for console interaction.\n\n**Typing** is fully supported. **Async** is also supported!\n\n## Installation\n\n```bash\npip install noneprompt\n```\n\n## Prompt Usage\n\n### Input\n\n```python\nfrom noneprompt import InputPrompt\n\nInputPrompt(\"What is your name?\", validator=lambda string: True).prompt()\nawait InputPrompt(\"What is your name?\", validator=lambda string: True).prompt_async()\n```\n\n### Confirm\n\n```python\nfrom noneprompt import ConfirmPrompt\n\nConfirmPrompt(\"Are you sure?\", default_choice=False).prompt()\nawait ConfirmPrompt(\"Are you sure?\", default_choice=False).prompt_async()\n```\n\n### List\n\n```python\nfrom noneprompt import ListPrompt, Choice\n\nListPrompt(\"What is your favorite color?\", choices=[Choice(\"Red\"), Choice(\"Blue\")]).prompt()\nawait ListPrompt(\"What is your favorite color?\", choices=[Choice(\"Red\"), Choice(\"Blue\")]).prompt_async()\n```\n\n### Checkbox\n\n```python\nfrom noneprompt import CheckboxPrompt, Choice\n\nCheckboxPrompt(\"Choose your favorite colors\", choices=[Choice(\"Red\"), Choice(\"Blue\")]).prompt()\nawait CheckboxPrompt(\"Choose your favorite colors\", choices=[Choice(\"Red\"), Choice(\"Blue\")]).prompt_async()\n```\n\n## Choice Data\n\nYou can add data to choices. Result type can be inferred from the data type.\n\n```python\nfrom noneprompt import ListPrompt, Choice\n\nresult: Choice[str] = ListPrompt(\n    \"What is your favorite color?\",\n    choices=[\n        Choice(\"Red\", data=\"#FF0000\"),\n        Choice(\"Blue\", data=\"#0000FF\"),\n    ],\n).prompt()\nprint(result.data)\n```\n\n## Defaults and Cancellation\n\n```python\nfrom noneprompt import InputPrompt\n\nresult = InputPrompt(\"Press Ctrl-C to cancel.\").prompt(default=\"Cancelled\")\nassert result == \"Cancelled\"\n```\n\n```python\nfrom noneprompt import InputPrompt, CancelledError\n\ntry:\n    InputPrompt(\"Press Ctrl-C to cancel.\").prompt()\nexcept CancelledError:\n    # Do something\n    pass\n```\n\n## Style Guide\n\nSee the docstring of prompt classes for more information.\n\n```python\nfrom noneprompt import InputPrompt\nfrom prompt_toolkit.styles import Style\n\nInputPrompt(\"What is your name?\").prompt(style=Style([(\"input\": \"#ffffff\"), (\"answer\": \"bold\")]))\n```\n\nDisable ansi colors:\n\n```python\nfrom noneprompt import InputPrompt\n\nInputPrompt(\"What is your name?\").prompt(no_ansi=True)\n```\n\n## Try from command line\n\n```bash\nnoneprompt -h\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnonebot%2Fnoneprompt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnonebot%2Fnoneprompt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnonebot%2Fnoneprompt/lists"}