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-tcli.svg?branch=master https://img.shields.io/pypi/v/python-cli-tcli.svg https://img.shields.io/github/license/TankerHQ/python-cli-tcli.svg

Documentation

See tcli documentation.

Demo

Watch the asciinema recording.

Usage

$ pip install tcli

Example:

import ui

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

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

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

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

fruits = ["apple", "orange", "banana"]
selected_fruit = tcli.ask_choice("Choose a fruit", 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.

Files for tcli, version 0.7.5
Filename, size File type Python version Upload date Hashes
Filename, size tcli-0.7.5-py3-none-any.whl (18.9 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page