Skip to main content

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!

Donate

The Pallets organization develops and supports Click and other popular packages. In order to grow the community of contributors and users, and allow the maintainers to devote more time to the projects, please donate today.

Release files for click 8.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for click 8.1.0
File Size Uploaded
click-8.1.0.tar.gz 330.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for click 8.1.0
File Interpreter ABI Platform
click-8.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 426.4 kB

Release files / click-8.1.0.tar.gz

Download URL click-8.1.0.tar.gz
Size 330.0 kB
Tags Source
SHA-256 checksum
How to use checksums
977c213473c7665d3aa092b41ff12063227751c41d7b17165013e10069cc5cd2
BLAKE2b-256 checksum
How to use checksums
452b7ebad1e59a99207d417c0784f7fb67893465eef84b5b47c788324f1b4095
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / click-8.1.0-py3-none-any.whl

Download URL click-8.1.0-py3-none-any.whl
Size 96.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
19a4baa64da924c5e0cd889aba8e947f280309f1a2ce0947a3e3a7bcb7cc72d6
BLAKE2b-256 checksum
How to use checksums
863e3a523bdd24510288b1b850428e01172116a29268378b1da9a8d0b894a115
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

8.5.0

2 release files

8.4.2

2 release files

8.4.1

2 release files

8.4.0

2 release files

8.3.3

2 release files

8.3.2

2 release files

8.3.1

2 release files

8.3.0

2 release files

8.2.2

2 release files

8.2.1

2 release files

8.2.0

2 release files

8.1.8

2 release files

8.1.7

2 release files

8.1.6

2 release files

8.1.5

2 release files

8.1.4

2 release files

8.1.3

2 release files

8.1.2

2 release files

8.1.1

2 release files

This release

8.1.0 This release

2 release files

8.0.4

2 release files

8.0.3

2 release files

8.0.2

2 release files

8.0.1

2 release files

8.0.0

2 release files

7.1.2

2 release files

7.1.1

2 release files

7.1

2 release files

7.0

2 release files

6.7

2 release files

6.6

2 release files

6.5

1 release file

6.4

2 release files

6.3

2 release files

6.2

2 release files

6.1

2 release files

6.0

2 release files

5.1

2 release files

5.0

2 release files

4.1

2 release files

4.0

2 release files

3.3

2 release files

3.2

2 release files

3.1

2 release files

3.0

2 release files

2.6

2 release files

2.5

2 release files

2.4

2 release files

2.3

2 release files

2.2

2 release files

2.1

2 release files

2.0

2 release files

1.1

2 release files

1.0

2 release files

0.7

2 release files

0.6

2 release files

0.5.1

2 release files

0.5

2 release files

0.4

2 release files

0.3

2 release files

0.2

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page