Skip to content
Myr

README.rst

This file

Path

README.rst

87 lines · 2.2 KiB

Last changed by

fix azure configDavid Lordbefore adoptionc2efed8

History of this file

Take it

Merge pull request #990 from dougharris/click-readmeDavid Lordbefore adoptiondf1a8f5

lines 1–4why, one step back
1\$ click\_
2==========34Click is a Python package for creating beautiful command line interfaces

Merge pull request #1120 from pallets/metaDavid Lordbefore adoptionb4d25f8

lines 5–6why, one step back
5in a composable way with as little code as necessary. It's the "Command
6Line Interface Creation Kit". It's highly configurable but comes with

Merge pull request #990 from dougharris/click-readmeDavid Lordbefore adoptiondf1a8f5

lines 7–9why, one step back
7sensible defaults out of the box.
89It aims to make the process of writing command line tools quick and fun

Merge pull request #1100 from pallets/sphinxDavid Lordbefore adoptionb1b8c48

lines 10–11why, one step back
10while also preventing any frustration caused by the inability to
11implement an intended CLI API.

Merge pull request #990 from dougharris/click-readmeDavid Lordbefore adoptiondf1a8f5

lines 12–14why, one step back
12
13Click in three points:14

Merge pull request #1120 from pallets/metaDavid Lordbefore adoptionb4d25f8

lines 15–17why, one step back
15- Arbitrary nesting of commands
16- Automatic help page generation17- Supports lazy loading of subcommands at runtime

Merge pull request #990 from dougharris/click-readmeDavid Lordbefore adoptiondf1a8f5

line 18why, one step back
18

Merge pull request #1100 from pallets/sphinxDavid Lordbefore adoptionb1b8c48

line 19why, one step back
19

Merge pull request #990 from dougharris/click-readmeDavid Lordbefore adoptiondf1a8f5

lines 20–28why, one step back
20Installing
21----------2223Install and update using `pip`_:2425.. code-block:: text2627 $ pip install click28

Merge pull request #1100 from pallets/sphinxDavid Lordbefore adoptionb1b8c48

line 29why, one step back
29Click supports Python 3.4 and newer, Python 2.7, and PyPy.

Merge pull request #1004 from dougharris/versions-743Dan Sullybefore adoptiona00e018

line 30why, one step back
30

Merge pull request #1100 from pallets/sphinxDavid Lordbefore adoptionb1b8c48

lines 31–33why, one step back
31.. _pip: https://pip.pypa.io/en/stable/quickstart/
3233

Merge pull request #990 from dougharris/click-readmeDavid Lordbefore adoptiondf1a8f5

lines 34–41why, one step back
34A Simple Example
35----------------3637What does it look like? Here is an example of a simple Click program:3839.. code-block:: python4041 import click

fix azure configDavid Lordbefore adoptionc2efed8

line 42why, one step back
42

Merge pull request #990 from dougharris/click-readmeDavid Lordbefore adoptiondf1a8f5

line 43why, one step back
43 @click.command()

Merge pull request #1120 from pallets/metaDavid Lordbefore adoptionb4d25f8

lines 44–46why, one step back
44 @click.option("--count", default=1, help="Number of greetings.")
45 @click.option("--name", prompt="Your name",46 help="The person to greet.")

Merge pull request #990 from dougharris/click-readmeDavid Lordbefore adoptiondf1a8f5

lines 47–48why, one step back
47 def hello(count, name):
48 """Simple program that greets NAME for a total of COUNT times."""

Merge pull request #1120 from pallets/metaDavid Lordbefore adoptionb4d25f8

lines 49–50why, one step back
49 for _ in range(count):
50 click.echo("Hello, %s!" % name)

fix azure configDavid Lordbefore adoptionc2efed8

line 51why, one step back
51

Merge pull request #990 from dougharris/click-readmeDavid Lordbefore adoptiondf1a8f5

lines 52–59why, one step back
52 if __name__ == '__main__':
53 hello()5455And what it looks like when run:5657.. code-block:: text5859 $ python hello.py --count=3

Merge pull request #1120 from pallets/metaDavid Lordbefore adoptionb4d25f8

lines 60–63why, one step back
60 Your name: Click
61 Hello, Click!62 Hello, Click!63 Hello, Click!

Merge pull request #990 from dougharris/click-readmeDavid Lordbefore adoptiondf1a8f5

line 64why, one step back
64

Merge pull request #1100 from pallets/sphinxDavid Lordbefore adoptionb1b8c48

line 65why, one step back
65

Merge pull request #990 from dougharris/click-readmeDavid Lordbefore adoptiondf1a8f5

lines 66–68why, one step back
66Donate
67------68

Merge pull request #1120 from pallets/metaDavid Lordbefore adoptionb4d25f8

lines 69–70why, one step back
69The Pallets organization develops and supports Click and other popular
70packages. In order to grow the community of contributors and users, and

Merge pull request #990 from dougharris/click-readmeDavid Lordbefore adoptiondf1a8f5

lines 71–73why, one step back
71allow the maintainers to devote more time to the projects, `please
72donate today`_.73

Merge pull request #1100 from pallets/sphinxDavid Lordbefore adoptionb1b8c48

line 74why, one step back
74.. _please donate today: https://palletsprojects.com/donate

Merge pull request #990 from dougharris/click-readmeDavid Lordbefore adoptiondf1a8f5

lines 75–79why, one step back
75
7677Links78-----79

Merge pull request #1100 from pallets/sphinxDavid Lordbefore adoptionb1b8c48

lines 80–81why, one step back
80* Website: https://palletsprojects.com/p/click/
81* Documentation: https://click.palletsprojects.com/

Merge pull request #1120 from pallets/metaDavid Lordbefore adoptionb4d25f8

line 82why, one step back
82* License: `BSD <https://github.com/pallets/click/blob/master/LICENSE.rst>`_

Merge pull request #1100 from pallets/sphinxDavid Lordbefore adoptionb1b8c48

lines 83–85why, one step back
83* Releases: https://pypi.org/project/click/
84* Code: https://github.com/pallets/click85* Issue tracker: https://github.com/pallets/click/issues

fix azure configDavid Lordbefore adoptionc2efed8

line 86why, one step back
86* Test status: https://dev.azure.com/pallets/click/_build

Add Discord server link to README (#1290)Peter Landollbefore adoptionafff366

line 87why, one step back
87* Official chat: https://discord.gg/t6rrQZH