Skip to content
Myr

index.rst

This file

Path

docs/index.rst

100 lines · 2.1 KiB

Last changed by

Documented wincmdArmin Ronacherbefore adoption7e8da4b

History of this file

Take it

1Welcome to the Click Documentation2==================================34Click is a Python package for creating beautiful command line interfaces5in a composable way with as little code as necessary.  It's the "Command6Line Interface Creation Kit".  It's highly configurable but comes with7sensible defaults out of the box.89It aims to make the process of writing command line tools quick and fun10while also preventing any frustration caused by the inability to implement11an intended CLI API.1213Click in three points:1415-   arbitrary nesting of commands16-   automatic help page generation17-   supports lazy loading of subcommands at runtime1819What does it look like?  Here is an example of a simple Click program:2021.. click:example::2223    import click2425    @click.command()26    @click.option('--count', default=1, help='Number of greetings.')27    @click.option('--name', prompt='Your name',28                  help='The person to greet.')29    def hello(count, name):30        """Simple program that greets NAME for a total of COUNT times."""31        for x in range(count):32            click.echo('Hello %s!' % name)3334    if __name__ == '__main__':35        hello()3637And what it looks like when run:3839.. click:run::4041    invoke(hello, ['--count=3'], prog_name='python hello.py', input='John\n')4243It automatically generates nicely formatted help pages:4445.. click:run::4647    invoke(hello, ['--help'], prog_name='python hello.py')4849You can get the library directly from PyPI::5051    pip install click5253Documentation Contents54----------------------5556This part of the documentation guides you through all of the library's57usage patterns.5859.. toctree::60   :maxdepth: 26162   why63   quickstart64   setuptools65   parameters66   options67   arguments68   commands69   prompts70   documentation71   complex72   advanced73   testing74   utils75   bashcomplete76   exceptions77   python378   wincmd7980API Reference81-------------8283If you are looking for information on a specific function, class, or84method, this part of the documentation is for you.8586.. toctree::87   :maxdepth: 28889   api9091Miscellaneous Pages92-------------------9394.. toctree::95   :maxdepth: 29697   contrib98   changelog99   upgrading100   license