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

Uploaded Source

Built Distribution

click_hotoffthehamster-7.1.1-py2.py3-none-any.whl (85.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file click-hotoffthehamster-7.1.1.tar.gz.

File metadata

  • Download URL: click-hotoffthehamster-7.1.1.tar.gz
  • Upload date:
  • Size: 304.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

File hashes

Hashes for click-hotoffthehamster-7.1.1.tar.gz
Algorithm Hash digest
SHA256 9dbcd9f3d3b42b52a91dd82586864d799bd0e063c7f1e39dfb7cf6c1ab3bc545
MD5 8350c1af83a1fc4d9d5bceacddd3afe5
BLAKE2b-256 9b3c13af0aec6006989a5882e5138c258a96e379ef88a3285ace3a009668ef19

See more details on using hashes here.

File details

Details for the file click_hotoffthehamster-7.1.1-py2.py3-none-any.whl.

File metadata

  • Download URL: click_hotoffthehamster-7.1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 85.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

File hashes

Hashes for click_hotoffthehamster-7.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4798479017ffd65a18e784655f602e321969758be1ec970fe879d41497001900
MD5 732e42094e17d44262ef8a5d5e8be4cc
BLAKE2b-256 83b5c1bdc7dc267ff88bdb5de950c230f0317e803f5990274cee8ae403077516

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