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.2.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

cli_ui-0.10.2-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cli-ui-0.10.2.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.3 CPython/3.7.1 Linux/5.4.0-3-amd64

File hashes

Hashes for cli-ui-0.10.2.tar.gz
Algorithm Hash digest
SHA256 af0a8aece8e70239e8d6635db768fa62bdba677d7ef81dac551efefd05f17bae
MD5 363d3e1aa9b5604e4a1e9d3e5a26ad51
BLAKE2b-256 f247d0e11f2dbe154c84687fd7c162e7a8ffcd01e207968265b9d40bb58e5d0b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cli_ui-0.10.2-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.3 CPython/3.7.1 Linux/5.4.0-3-amd64

File hashes

Hashes for cli_ui-0.10.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f9ec87002e29848f6ad59fa19a7a512d951cd299d61d520f49c54391036c1669
MD5 e6f6717102c83e5c88529cced652ec2c
BLAKE2b-256 a98ea4d73c577f8a8934fe51fb4f696b9c48e33822ad40f69e2d6a1d43a2771c

See more details on using hashes here.

Supported by

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