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!

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

click_hotoffthehamster-7.1.2-py2.py3-none-any.whl (85.8 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: click-hotoffthehamster-7.1.2.tar.gz
  • Upload date:
  • Size: 304.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.44.0 CPython/3.8.3

File hashes

Hashes for click-hotoffthehamster-7.1.2.tar.gz
Algorithm Hash digest
SHA256 011753cd2ad237ad8cb538b918838fa6817dffe24a3d7d1f9191f0a9c203ea4b
MD5 ce448165675e60ebda5268a88dea3c22
BLAKE2b-256 9fc4e25d2768a6703a8df1a9de7eb17f1efab02c63e4bcac2ff9671b48d611c4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: click_hotoffthehamster-7.1.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 85.8 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/47.3.1 requests-toolbelt/0.9.1 tqdm/4.44.0 CPython/3.8.3

File hashes

Hashes for click_hotoffthehamster-7.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f70b4a2f55166d6b44997a98cf24ef1c441639c7ae02255f56241d06d4fbeb5e
MD5 b1cdb556630052fd763b079193fc1432
BLAKE2b-256 232925c882939d46d5c332a80f8e6234414e1d925b1fec4a488a743d86cac40a

See more details on using hashes here.

Supported by

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