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

Uploaded Source

Built Distribution

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

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

Uploaded Python 2Python 3

File details

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

File metadata

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

File hashes

Hashes for click-7.1.tar.gz
Algorithm Hash digest
SHA256 482f552f2d5452b9eeffc44165e8b790dd53f75bcce099a812b65e0357e860e2
MD5 9ad03e1a9c120f45ba9d6036d008b08f
BLAKE2b-256 17952028e02161ff874334008e853b1708d6b8d960218fd2f4bf9f6efd5de002

See more details on using hashes here.

File details

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

File metadata

  • Download URL: click-7.1-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/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.2

File hashes

Hashes for click-7.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 91eb2c43db0254aaf3b14a3c4e0db914a900aa09bbc33c6e87ede4a8f7c969dc
MD5 f71eec330635125c35f2fa7a1216a3a6
BLAKE2b-256 cf1403d1edbed5fe8be89d0938f8bc015f97cc6ff47af55d1195ec0fab978e64

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