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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

click-8.1.1-py3-none-any.whl (96.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: click-8.1.1.tar.gz
  • Upload date:
  • Size: 330.2 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.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for click-8.1.1.tar.gz
Algorithm Hash digest
SHA256 7ab900e38149c9872376e8f9b5986ddcaf68c0f413cf73678a0bca5547e6f976
MD5 5a39737d25ed6b05ceb39776f17a54d0
BLAKE2b-256 ba1c9490d7fd88dd612f2f6ced0fac0560f160d434f28bf3f2fe4173d6b79cae

See more details on using hashes here.

File details

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

File metadata

  • Download URL: click-8.1.1-py3-none-any.whl
  • Upload date:
  • Size: 96.6 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.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for click-8.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5e0d195c2067da3136efb897449ec1e9e6c98282fbf30d7f9e164af9be901a6b
MD5 94b4e0e71c00122594ec8d7589185920
BLAKE2b-256 97b259e9a416766a54e182ad4980c96b097bf1b9fb6dee5f2ffc5f4b3c5d9800

See more details on using hashes here.

Supported by

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