{"id":4475,"library":"cli-helpers","title":"CLI Helpers","description":"CLI Helpers is a Python package that simplifies common tasks in building command-line applications. It serves as a helper library for command-line interfaces, complementing tools like Click and Python Prompt Toolkit by offering simple interfaces for tasks such as pretty-printing tabular data and handling configuration files. The current version is 2.12.0, with ongoing development and updates.","status":"active","version":"2.12.0","language":"en","source_language":"en","source_url":"https://github.com/dbcli/cli_helpers","tags":["cli","helpers","tabular data","pretty print","configuration","python"],"install":[{"cmd":"pip install cli-helpers","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Used by `tabular_output` for various display formats.","package":"tabulate","optional":false},{"reason":"Used by `tabular_output` for various display formats.","package":"terminaltables","optional":false}],"imports":[{"note":"Provides functions for formatting tabular data.","symbol":"tabular_output","correct":"from cli_helpers import tabular_output"},{"note":"Allows access to the formatter class for more control over tabular output formats.","symbol":"TabularOutputFormatter","correct":"from cli_helpers.tabular_output import TabularOutputFormatter"}],"quickstart":{"code":"from cli_helpers import tabular_output\n\ndata = [[1, 'Asgard', True], [2, 'Camelot', False], [3, 'El Dorado', True]]\nheaders = ['id', 'city', 'visited']\n\n# Format output using the 'simple' display format\noutput_lines = tabular_output.format_output(iter(data), headers, format_name='simple')\nprint(\"\\n\".join(output_lines))\n\n# Example with a different format using TabularOutputFormatter\nfrom cli_helpers.tabular_output import TabularOutputFormatter\nformatter = TabularOutputFormatter()\noutput_fancy = formatter.format_output(iter(data), headers, format_name='fancy_grid')\nprint(\"\\n\".join(output_fancy))","lang":"python","description":"This quickstart demonstrates how to use `cli-helpers` to pretty-print tabular data. It shows both the direct `tabular_output.format_output` function and the `TabularOutputFormatter` class for more advanced formatting options."},"warnings":[{"fix":"Upgrade your Python environment to version 3.6 or higher.","message":"Support for Python 2.7 and 3.5 has been removed. Users on these older Python versions must upgrade to Python 3.6 or newer to use `cli-helpers` version 2.x and above.","severity":"breaking","affected_versions":"2.x and later"},{"fix":"Always install/update `cli-helpers` in a fresh environment or ensure its dependencies are also updated: `pip install --upgrade cli-helpers tabulate terminaltables`.","message":"Updating `cli-helpers` may require updating its core tabular formatting dependencies (e.g., `tabulate`, `terminaltables`) to their latest versions to avoid `ImportError` or other compatibility issues. Ensure all related packages are up-to-date.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}