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

Uploaded Source

Built Distribution

click-8.0.1-py3-none-any.whl (97.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: click-8.0.1.tar.gz
  • Upload date:
  • Size: 327.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.1

File hashes

Hashes for click-8.0.1.tar.gz
Algorithm Hash digest
SHA256 8c04c11192119b1ef78ea049e0a6f0463e4c48ef00a30160c704337586f3ad7a
MD5 ff66f850b8eb4dc618b405d7fe22a0c2
BLAKE2b-256 2183308a74ca1104fe1e3197d31693a7a2db67c2d4e668f20f43a2fca491f9f7

See more details on using hashes here.

File details

Details for the file click-8.0.1-py3-none-any.whl.

File metadata

  • Download URL: click-8.0.1-py3-none-any.whl
  • Upload date:
  • Size: 97.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.1

File hashes

Hashes for click-8.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fba402a4a47334742d782209a7c79bc448911afe1149d07bdabdf480b3e2f4b6
MD5 b0ea4bceb2610bece94ded2424ce9448
BLAKE2b-256 760ab6c5f311e32aeb3b406e03c079ade51e905ea630fc19d1262a46249c1c86

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