Skip to content
Myr

README.rst

This file

Path

README.rst

79 lines · 2.0 KiB

Last changed by

Merge branch '7.x'David Lordbefore adoption7239794

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–26why, one step back
20Installing
21----------2223Install and update using `pip`_:2425.. code-block:: text26

Merge branch '7.x'David Lordbefore adoption8f36eab

line 27why, one step back
27 $ pip install -U click

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

line 28why, one step back
28

Merge pull request #1100 from pallets/sphinxDavid Lordbefore adoptionb1b8c48

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

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

lines 32–37why, one step back
32A Simple Example
33----------------3435.. code-block:: python3637 import click

Merge branch '7.x'David Lordbefore adoptiona438322

line 38why, one step back
38

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

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

Merge pull request #1120 from pallets/metaDavid Lordbefore adoptionb4d25f8

line 40why, one step back
40 @click.option("--count", default=1, help="Number of greetings.")

Merge branch '7.x'David Lordbefore adoption7239794

line 41why, one step back
41 @click.option("--name", prompt="Your name", help="The person to greet.")

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

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

Merge pull request #1120 from pallets/metaDavid Lordbefore adoptionb4d25f8

line 44why, one step back
44 for _ in range(count):

Merge branch '7.x'David Lordbefore adoption7239794

line 45why, one step back
45 click.echo(f"Hello, {name}!")

Merge branch '7.x'David Lordbefore adoptiona438322

line 46why, one step back
46

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

lines 47–52why, one step back
47 if __name__ == '__main__':
48 hello()4950.. code-block:: text5152 $ python hello.py --count=3

Merge pull request #1120 from pallets/metaDavid Lordbefore adoptionb4d25f8

lines 53–56why, one step back
53 Your name: Click
54 Hello, Click!55 Hello, Click!56 Hello, Click!

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

line 57why, one step back
57

Merge pull request #1100 from pallets/sphinxDavid Lordbefore adoptionb1b8c48

line 58why, one step back
58

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

lines 59–61why, one step back
59Donate
60------61

Merge pull request #1120 from pallets/metaDavid Lordbefore adoptionb4d25f8

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

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

lines 64–66why, one step back
64allow the maintainers to devote more time to the projects, `please
65donate today`_.66

Merge pull request #1100 from pallets/sphinxDavid Lordbefore adoptionb1b8c48

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

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

lines 68–72why, one step back
68
6970Links71-----72

Merge branch '7.x'David Lordbefore adoption8f36eab

lines 73–79why, one step back
73- Website: https://palletsprojects.com/p/click/
74- Documentation: https://click.palletsprojects.com/75- Releases: https://pypi.org/project/click/76- Code: https://github.com/pallets/click77- Issue tracker: https://github.com/pallets/click/issues78- Test status: https://dev.azure.com/pallets/click/_build79- Official chat: https://discord.gg/t6rrQZH