Skip to content
Python composable command line interface toolkit
Python
Branch: master
Clone or download

Latest commit

dependabot-preview Bump pip-tools from 5.1.2 to 5.2.0 (#1564)
Bumps [pip-tools](https://github.com/jazzband/pip-tools) from 5.1.2 to 5.2.0.
- [Release notes](https://github.com/jazzband/pip-tools/releases)
- [Changelog](https://github.com/jazzband/pip-tools/blob/master/CHANGELOG.md)
- [Commits](jazzband/pip-tools@5.1.2...5.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Latest commit da7bf34 May 28, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github use GitHub Actions for CI May 23, 2020
artwork Initial commit Apr 24, 2014
docs use pip-compile to pin dev requirements May 23, 2020
examples f-strings everywhere Apr 20, 2020
requirements Bump pip-tools from 5.1.2 to 5.2.0 (#1564) May 28, 2020
src/click Merge branch '7.x' Apr 27, 2020
tests Merge branch '7.x' Apr 27, 2020
.editorconfig add EditorConfig May 23, 2020
.gitignore update project metadata Feb 27, 2020
.pre-commit-config.yaml use pip-compile to pin dev requirements May 23, 2020
.readthedocs.yaml use pip-compile to pin dev requirements May 23, 2020
CHANGES.rst Merge branch '7.x' Apr 27, 2020
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md May 6, 2019
CONTRIBUTING.rst apply formatting Mar 6, 2020
LICENSE.rst update project metadata Feb 27, 2020
MANIFEST.in use pip-compile to pin dev requirements May 23, 2020
README.rst manual cleanup Mar 8, 2020
setup.cfg drop support for Python 2.7 and 3.5 Apr 20, 2020
setup.py drop support for Python 2.7 and 3.5 Apr 20, 2020
tox.ini use pip-compile to pin dev requirements May 23, 2020

README.rst

$ click_

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.

Links

You can’t perform that action at this time.