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

Uploaded Source

Built Distribution

click-8.1.0-py3-none-any.whl (96.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: click-8.1.0.tar.gz
  • Upload date:
  • Size: 330.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for click-8.1.0.tar.gz
Algorithm Hash digest
SHA256 977c213473c7665d3aa092b41ff12063227751c41d7b17165013e10069cc5cd2
MD5 ea900ec8ef92c36a94163e22b8779db8
BLAKE2b-256 452b7ebad1e59a99207d417c0784f7fb67893465eef84b5b47c788324f1b4095

See more details on using hashes here.

File details

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

File metadata

  • Download URL: click-8.1.0-py3-none-any.whl
  • Upload date:
  • Size: 96.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for click-8.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 19a4baa64da924c5e0cd889aba8e947f280309f1a2ce0947a3e3a7bcb7cc72d6
MD5 c64c296701768a118f5bbbb7a3218a84
BLAKE2b-256 863e3a523bdd24510288b1b850428e01172116a29268378b1da9a8d0b894a115

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