Skip to main content

Composable command line interface toolkit

Project description

$ click_

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

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.

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

Uploaded Source

Built Distribution

click-8.1.8-py3-none-any.whl (98.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: click-8.1.8.tar.gz
  • Upload date:
  • Size: 226.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for click-8.1.8.tar.gz
Algorithm Hash digest
SHA256 ed53c9d8990d83c2a27deae68e4ee337473f6330c040a31d4225c9574d16096a
MD5 b52ee8e6c33d88a2b4626e6a6002245d
BLAKE2b-256 b92e0090cbf739cee7d23781ad4b89a9894a41538e4fcf4c31dcdd705b78eb8b

See more details on using hashes here.

Provenance

The following attestation bundles were made for click-8.1.8.tar.gz:

Publisher: publish.yaml on pallets/click

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: click-8.1.8-py3-none-any.whl
  • Upload date:
  • Size: 98.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for click-8.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 63c132bbbed01578a06712a2d1f497bb62d9c1c0d329b7903a866228027263b2
MD5 7dc0eee374f3bb75bcce4c9dd4222f5f
BLAKE2b-256 7ed47ebdbd03970677812aac39c869717059dbb71a4cfc033ca6e5221787892c

See more details on using hashes here.

Provenance

The following attestation bundles were made for click-8.1.8-py3-none-any.whl:

Publisher: publish.yaml on pallets/click

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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