ClickClick Utility Functions
ClickClick (v20.10.2) provides common helper functionality for Click-based Command Line Interfaces (CLIs), such as formatted output (tables, colored messages), terminal diffs, progress bars, and aliased command groups. It is currently in maintenance mode with infrequent releases; the last major release was in October 2020.
Warnings
- gotcha ClickClick has been in maintenance mode since its last release in October 2020. While stable, new features for `click` or significant API changes in `click` might not be immediately supported or integrated.
- gotcha The library depends on `six` for Python 2/3 compatibility. For Python 3-only projects, this dependency is often unnecessary and adds a potentially unused package to your environment.
- gotcha ClickClick does not specify a strict version range for its `click` dependency. While generally robust, this could theoretically lead to compatibility issues with very old or very new `click` versions if `clickclick`'s internal assumptions about `click`'s API diverge.
Install
-
pip install clickclick
Imports
- print_table
from clickclick import print_table
- print_info
from clickclick import print_info
- AliasedGroup
from clickclick import AliasedGroup
Quickstart
import click
from clickclick import print_table
@click.command()
def main():
"""Example CLI using clickclick's print_table."""
click.echo("Fetching data...")
headers = ['ID', 'Name', 'Status']
rows = [
{'ID': 1, 'Name': 'Task A', 'Status': 'Done'},
{'ID': 2, 'Name': 'Task B', 'Status': 'Pending'},
{'ID': 3, 'Name': 'Task C', 'Status': 'Error'}
]
print_table(headers, rows, max_column_width=40)
click.echo("Table printed.")
if __name__ == '__main__':
main()