Skip to main content

Build Nice User Interfaces In The Terminal

Project description

Tools for nice user interfaces in the terminal.

https://img.shields.io/travis/TankerHQ/python-cli-ui.svg?branch=master https://img.shields.io/pypi/pyversions/cli-ui.svg https://img.shields.io/pypi/v/cli-ui.svg https://img.shields.io/github/license/TankerHQ/python-cli-ui.svg

Documentation

See python-cli-ui documentation.

Demo

Watch the asciinema recording.

Usage

$ pip install cli-ui

Example:

import cli_ui

# coloring:
cli_ui.info(
  "This is",
  cli_ui.red, "red", cli_ui.reset,
  "and this is",
  cli_ui.bold, "bold"
)

# enumerating:
list_of_things = ["foo", "bar", "baz"]
for i, thing in enumerate(list_of_things):
    cli_ui.info_count(i, len(list_of_things), thing)

# progress indication:
cli_ui.info_progress("Done",  5, 20)
cli_ui.info_progress("Done", 10, 20)
cli_ui.info_progress("Done", 20, 20)

# reading user input:
with_sugar = cli_ui.ask_yes_no("With sugar?", default=False)

fruits = ["apple", "orange", "banana"]
selected_fruit = cli_ui.ask_choice("Choose a fruit", choices=fruits)

#  ... and more!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cli-ui-0.10.3.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cli_ui-0.10.3-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file cli-ui-0.10.3.tar.gz.

File metadata

  • Download URL: cli-ui-0.10.3.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.7 Linux/5.3.0-46-generic

File hashes

Hashes for cli-ui-0.10.3.tar.gz
Algorithm Hash digest
SHA256 be517ec1a5385eb22c06d578c08ca65be59a33f00a0c09aa111db44a2f9dd211
MD5 8f2ebefeb135b15c4651d605ee5b2ef1
BLAKE2b-256 2c762869531e86c69538f522567aa7ce6a30101cc049ad03afee7f37df1b2cf8

See more details on using hashes here.

File details

Details for the file cli_ui-0.10.3-py3-none-any.whl.

File metadata

  • Download URL: cli_ui-0.10.3-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.7 Linux/5.3.0-46-generic

File hashes

Hashes for cli_ui-0.10.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b1085140a4c843f7fb6053d25a25763ddf4c63106a3345a0b12303a4ff840a25
MD5 0a8ebb76f02c8ef8c02fbd1f092a8479
BLAKE2b-256 53a39ecd5b1959ee455b5bd49eb617116c80bae490c1c341ba3782719fed1c25

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page