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

Uploaded Source

Built Distribution

click_hotoffthehamster-7.8.2-py3-none-any.whl (101.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: click_hotoffthehamster-7.8.2.tar.gz
  • Upload date:
  • Size: 103.3 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.2.tar.gz
Algorithm Hash digest
SHA256 4d6c289fcdf4e8456d181f4e0a86f76a5e3c76c2390330f23459507335c87336
MD5 08e52351d5c6e8e43da4c32e69dea3ff
BLAKE2b-256 026f58a29717867e590a1113268b0c4a2f101cd3d0eb3ddb647ddb694b31eace

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for click_hotoffthehamster-7.8.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4020ed5d9b0c0067ad69e867ac4deac4890af5b41dab34115e9f6ed8103676ec
MD5 24247a2a2a4c6c37bcf4d506603b0408
BLAKE2b-256 b5d57b69e758b4f1b13d55518584efbb9a59e2e3fac269ff3933e4f6a892d4e7

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