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!

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.8.3.tar.gz (103.0 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.8.3-py3-none-any.whl (100.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: click_hotoffthehamster-7.8.3.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.3.tar.gz
Algorithm Hash digest
SHA256 601141eeb8110a4a48c28ac50429858d212e1123ae56d703a45327d22fd44185
MD5 9c689444e6249bff8a6dc9d2284b2eea
BLAKE2b-256 5e2dfcca0bdb72b3508c9d4bca2af8261490dc54aa15b5a75393d34c3bd39ff7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for click_hotoffthehamster-7.8.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6007f77fdb705376c1856ecb656e34a7b9bdb013c08836db2e960568ffe5b011
MD5 f587a132fee841398f5d4d5de2dcb1b1
BLAKE2b-256 9c2de7278e9aaf8ebda156d5bbbc51663e933a667274e69083286276715578b5

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