pickpy


Namepickpy JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummaryLightweight terminal menu library with TTY fallback and safe output
upload_time2025-08-30 21:52:56
maintainerNone
docs_urlNone
authorpickpy authors
requires_python>=3.10
licenseNone
keywords terminal menu tty console ansi
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pickpy: Lightweight Terminal Menus for Python

![License Badge](https://img.shields.io/badge/license-MIT-blue.svg)
![Python Version](https://img.shields.io/badge/python-%3E=3.10-green.svg)

## 📝 Usage example
Here's a quick example to spark your imagination:
```python
from pickpy.menu import TerminalMenu

options = ["Start Game", "Options", "Exit"]
menu = TerminalMenu()

choice = menu.select_option(
    options, 
    header="Pickpy Demo: Use arrow keys to navigate and press Enter"
)

match choice:
    case "Start Game":
        print("Starting game... (demo)")
    case "Options":
        print("Opening options...")
    case "Exit":
        print("Exiting...")
```

<img src="images/pickpy.gif" loop=infinite />


---

Are you tired of clunky, hard-to-use terminal menus? Want to build sleek, interactive command-line interfaces with minimal effort? Look no further — **pickpy** is here to revolutionize how you create terminal menus in Python!

## 🎨 Custom colors
You can customize colors easily using ANSI strings or the built-in BColors enum:
```python
from pickpy.menu import TerminalMenu
from pickpy.terminal import BColors

menu = TerminalMenu()

# Interactive menu with custom colors
choice = menu.select_option(
    ["Start", "Options", "Exit"],
    header="Custom Colors Demo",
    header_color=BColors.OKBLUE,
    selected_color=BColors.WARNING,
    unselected_color=BColors.OKGREEN,
)

# Fallback (non-TTY) also supports custom colors via get_choice
choice = menu.get_choice(
    ["Red", "Green", "Blue"],
    header="Pick a color:",
    header_color=BColors.WARNING,
    option_color=BColors.OKGREEN,
)

# Customize input prompt color
match choice:
    case "Red":
        menu.terminal.safe_print("You picked Red!", color=BColors.FAIL)
    case "Green":
        menu.terminal.safe_print("You picked Green!", color=BColors.OKGREEN)
    case "Blue":
        menu.terminal.safe_print("You picked Blue!", color=BColors.OKBLUE)
```
![pickpy_colors.gif](images/pickpy_colors.gif)


## 🚀 Why choose pickpy?

- **Lightweight & Easy to Use:** Designed for simplicity, perfect for quick prototyping or production use.
- **Flexible & Customizable:** Supports color, navigation via arrow keys, and safe terminal handling – all out of the box.
- **Cross-Platform Compatibility:** Works smoothly on Windows, macOS, and Linux.
- **Extensible & Modular:** Built with best practices to allow easy future enhancements.

## 🎯 What can you do with pickpy?

- Build interactive menus with arrow key navigation
- Present choices with color themes and style
- Support non-interactive environments gracefully
- Easily extend or embed into your scripts or tools

## 📦 Installation

Getting started is a snap:

```bash
pip install pickpy
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pickpy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "terminal, menu, tty, console, ansi",
    "author": "pickpy authors",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/19/e9/e5862fc08ef38216a469f3f21617903104a3c597f0efd1816906123d85a7/pickpy-0.1.1.tar.gz",
    "platform": null,
    "description": "# pickpy: Lightweight Terminal Menus for Python\r\n\r\n![License Badge](https://img.shields.io/badge/license-MIT-blue.svg)\r\n![Python Version](https://img.shields.io/badge/python-%3E=3.10-green.svg)\r\n\r\n## \ud83d\udcdd Usage example\r\nHere's a quick example to spark your imagination:\r\n```python\r\nfrom pickpy.menu import TerminalMenu\r\n\r\noptions = [\"Start Game\", \"Options\", \"Exit\"]\r\nmenu = TerminalMenu()\r\n\r\nchoice = menu.select_option(\r\n    options, \r\n    header=\"Pickpy Demo: Use arrow keys to navigate and press Enter\"\r\n)\r\n\r\nmatch choice:\r\n    case \"Start Game\":\r\n        print(\"Starting game... (demo)\")\r\n    case \"Options\":\r\n        print(\"Opening options...\")\r\n    case \"Exit\":\r\n        print(\"Exiting...\")\r\n```\r\n\r\n<img src=\"images/pickpy.gif\" loop=infinite />\r\n\r\n\r\n---\r\n\r\nAre you tired of clunky, hard-to-use terminal menus? Want to build sleek, interactive command-line interfaces with minimal effort? Look no further \u2014 **pickpy** is here to revolutionize how you create terminal menus in Python!\r\n\r\n## \ud83c\udfa8 Custom colors\r\nYou can customize colors easily using ANSI strings or the built-in BColors enum:\r\n```python\r\nfrom pickpy.menu import TerminalMenu\r\nfrom pickpy.terminal import BColors\r\n\r\nmenu = TerminalMenu()\r\n\r\n# Interactive menu with custom colors\r\nchoice = menu.select_option(\r\n    [\"Start\", \"Options\", \"Exit\"],\r\n    header=\"Custom Colors Demo\",\r\n    header_color=BColors.OKBLUE,\r\n    selected_color=BColors.WARNING,\r\n    unselected_color=BColors.OKGREEN,\r\n)\r\n\r\n# Fallback (non-TTY) also supports custom colors via get_choice\r\nchoice = menu.get_choice(\r\n    [\"Red\", \"Green\", \"Blue\"],\r\n    header=\"Pick a color:\",\r\n    header_color=BColors.WARNING,\r\n    option_color=BColors.OKGREEN,\r\n)\r\n\r\n# Customize input prompt color\r\nmatch choice:\r\n    case \"Red\":\r\n        menu.terminal.safe_print(\"You picked Red!\", color=BColors.FAIL)\r\n    case \"Green\":\r\n        menu.terminal.safe_print(\"You picked Green!\", color=BColors.OKGREEN)\r\n    case \"Blue\":\r\n        menu.terminal.safe_print(\"You picked Blue!\", color=BColors.OKBLUE)\r\n```\r\n![pickpy_colors.gif](images/pickpy_colors.gif)\r\n\r\n\r\n## \ud83d\ude80 Why choose pickpy?\r\n\r\n- **Lightweight & Easy to Use:** Designed for simplicity, perfect for quick prototyping or production use.\r\n- **Flexible & Customizable:** Supports color, navigation via arrow keys, and safe terminal handling \u2013 all out of the box.\r\n- **Cross-Platform Compatibility:** Works smoothly on Windows, macOS, and Linux.\r\n- **Extensible & Modular:** Built with best practices to allow easy future enhancements.\r\n\r\n## \ud83c\udfaf What can you do with pickpy?\r\n\r\n- Build interactive menus with arrow key navigation\r\n- Present choices with color themes and style\r\n- Support non-interactive environments gracefully\r\n- Easily extend or embed into your scripts or tools\r\n\r\n## \ud83d\udce6 Installation\r\n\r\nGetting started is a snap:\r\n\r\n```bash\r\npip install pickpy\r\n```\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Lightweight terminal menu library with TTY fallback and safe output",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://github.com/fcaffaro/pickpy",
        "Issues": "https://github.com/fcaffaro/pickpy/issues",
        "Source": "https://github.com/fcaffaro/pickpy"
    },
    "split_keywords": [
        "terminal",
        " menu",
        " tty",
        " console",
        " ansi"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8e5fdecbba4663f218341adc2434f02b6ea77806c017fe8121847e2e4469c324",
                "md5": "1ca412de0adba196ef09c377e5058a86",
                "sha256": "af928d5385ef67dbd80ca937353e89030e1e210735f9eea0917e020c69d1630e"
            },
            "downloads": -1,
            "filename": "pickpy-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1ca412de0adba196ef09c377e5058a86",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 8898,
            "upload_time": "2025-08-30T21:52:55",
            "upload_time_iso_8601": "2025-08-30T21:52:55.263903Z",
            "url": "https://files.pythonhosted.org/packages/8e/5f/decbba4663f218341adc2434f02b6ea77806c017fe8121847e2e4469c324/pickpy-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "19e9e5862fc08ef38216a469f3f21617903104a3c597f0efd1816906123d85a7",
                "md5": "de8f4499e018c77b75368333f9b21d15",
                "sha256": "e61d57c0a0e56a8ff4e640b724dcdab0710ae2e75c90b7f43fc9bf1d03a08227"
            },
            "downloads": -1,
            "filename": "pickpy-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "de8f4499e018c77b75368333f9b21d15",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 7934,
            "upload_time": "2025-08-30T21:52:56",
            "upload_time_iso_8601": "2025-08-30T21:52:56.535087Z",
            "url": "https://files.pythonhosted.org/packages/19/e9/e5862fc08ef38216a469f3f21617903104a3c597f0efd1816906123d85a7/pickpy-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-30 21:52:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "fcaffaro",
    "github_project": "pickpy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pickpy"
}
        
Elapsed time: 1.67935s