Skip to main content

Composable command line interface toolkit

Project description

Click is a Python package for creating beautiful command line interfaces in a composable way with as little code as necessary. It’s the “Command Line Interface Creation Kit”. It’s highly configurable but comes with sensible defaults out of the box.

It aims to make the process of writing command line tools quick and fun while also preventing any frustration caused by the inability to implement an intended CLI API.

Click in three points:

  • Arbitrary nesting of commands

  • Automatic help page generation

  • Supports lazy loading of subcommands at runtime

Installing

Install and update using pip:

$ pip install -U click

A Simple Example

import click

@click.command()
@click.option("--count", default=1, help="Number of greetings.")
@click.option("--name", prompt="Your name", help="The person to greet.")
def hello(count, name):
    """Simple program that greets NAME for a total of COUNT times."""
    for _ in range(count):
        click.echo(f"Hello, {name}!")

if __name__ == '__main__':
    hello()
$ python hello.py --count=3
Your name: Click
Hello, Click!
Hello, Click!
Hello, Click!

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

click-7.1.2.tar.gz (297.3 kB view details)

Uploaded Source

Built Distribution

click-7.1.2-py2.py3-none-any.whl (82.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file click-7.1.2.tar.gz.

File metadata

  • Download URL: click-7.1.2.tar.gz
  • Upload date:
  • Size: 297.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.2

File hashes

Hashes for click-7.1.2.tar.gz
Algorithm Hash digest
SHA256 d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a
MD5 53692f62cb99a1a10c59248f1776d9c0
BLAKE2b-256 276fbe940c8b1f1d69daceeb0032fee6c34d7bd70e3e649ccac0951500b4720e

See more details on using hashes here.

File details

Details for the file click-7.1.2-py2.py3-none-any.whl.

File metadata

  • Download URL: click-7.1.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 82.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.2

File hashes

Hashes for click-7.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc
MD5 b4233221cacc473acd422a1d54ff4c41
BLAKE2b-256 d23dfa76db83bf75c4f8d338c2fd15c8d33fdd7ad23a9b5e57eb6c5de26b430e

See more details on using hashes here.

Supported by

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