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.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

tcli-0.7.5-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file tcli-0.7.5-py3-none-any.whl.

File metadata

  • Download URL: tcli-0.7.5-py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for tcli-0.7.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ac7e4775202c6404008f5f4a03d2cf4dcbeb3e906b4f441e160ae0344bfc8b9a
MD5 f6424939532885e2c7d8426df3295b80
BLAKE2b-256 e47e7bc72fdc55d61db84559e56ad3d133e6800522847a81dfba5ca7ee90daf4

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