click

Package — CLIPython 3.7+Intermediate

Composable CLI toolkit with decorators for options and arguments

Quick Info

Documentation
Official Docs
Python Version
3.7+
Dependencies
None (pure Python)
Install
pip install click

Learn by Difficulty

Quick Example

python
# Install: pip install click
import click

@click.command()
@click.option("--name", default="World", help="Who to greet")
@click.option("--count", default=1, help="Number of greetings")
def hello(name, count):
    for _ in range(count):
        click.echo(f"Hello, {name}!")

if __name__ == "__main__":
    hello()

click is a third-party package. Composable CLI toolkit with decorators for options and arguments. Install with: pip install click

Try in Playground

Tags

packageclicommand-linedecoratorargument-parsing

Related Items