Skip to main content

Composable command line interface toolkit

Project description

Build Status Coverage Status Documentation Status GitHub Release Status PyPI Release Status PyPI Supported Python Versions License Status

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

Uploaded Source

Built Distribution

click_hotoffthehamster-7.8.4-py3-none-any.whl (100.9 kB view details)

Uploaded Python 3

File details

Details for the file click_hotoffthehamster-7.8.4.tar.gz.

File metadata

  • Download URL: click_hotoffthehamster-7.8.4.tar.gz
  • Upload date:
  • Size: 103.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for click_hotoffthehamster-7.8.4.tar.gz
Algorithm Hash digest
SHA256 2bc509c4e14423fba1ac737d2b368001dbd664b1c15307e8c3a0ae30bac6f04f
MD5 29dc020d83e4e18478c966066c79e8bb
BLAKE2b-256 7a7b667741fa9d7d43e28acbf5a3a6285bd4adec711c94d75f42ae863addf69a

See more details on using hashes here.

File details

Details for the file click_hotoffthehamster-7.8.4-py3-none-any.whl.

File metadata

File hashes

Hashes for click_hotoffthehamster-7.8.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a1a90726b3ea4d2018f3f654a4cdadbe36f122b565db9edafeaf3fc30aeb297f
MD5 e8600cf6a976f2e1e0e25260d04e4c6d
BLAKE2b-256 d57d4312912f4d68857dbd67aa76d06a9146ba9d64b30086cbbd1b47d75c8278

See more details on using hashes here.

Supported by

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