README.rst 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. \$ click\_
  2. ==========
  3. Click is a Python package for creating beautiful command line interfaces
  4. in a composable way with as little code as necessary. It's the "Command
  5. Line Interface Creation Kit". It's highly configurable but comes with
  6. sensible defaults out of the box.
  7. It aims to make the process of writing command line tools quick and fun
  8. while also preventing any frustration caused by the inability to
  9. implement an intended CLI API.
  10. Click in three points:
  11. - Arbitrary nesting of commands
  12. - Automatic help page generation
  13. - Supports lazy loading of subcommands at runtime
  14. Installing
  15. ----------
  16. Install and update using `pip`_:
  17. .. code-block:: text
  18. $ pip install -U click
  19. .. _pip: https://pip.pypa.io/en/stable/quickstart/
  20. A Simple Example
  21. ----------------
  22. .. code-block:: python
  23. import click
  24. @click.command()
  25. @click.option("--count", default=1, help="Number of greetings.")
  26. @click.option("--name", prompt="Your name", help="The person to greet.")
  27. def hello(count, name):
  28. """Simple program that greets NAME for a total of COUNT times."""
  29. for _ in range(count):
  30. click.echo(f"Hello, {name}!")
  31. if __name__ == '__main__':
  32. hello()
  33. .. code-block:: text
  34. $ python hello.py --count=3
  35. Your name: Click
  36. Hello, Click!
  37. Hello, Click!
  38. Hello, Click!
  39. Donate
  40. ------
  41. The Pallets organization develops and supports Click and other popular
  42. packages. In order to grow the community of contributors and users, and
  43. allow the maintainers to devote more time to the projects, `please
  44. donate today`_.
  45. .. _please donate today: https://palletsprojects.com/donate
  46. Links
  47. -----
  48. - Website: https://palletsprojects.com/p/click/
  49. - Documentation: https://click.palletsprojects.com/
  50. - Releases: https://pypi.org/project/click/
  51. - Code: https://github.com/pallets/click
  52. - Issue tracker: https://github.com/pallets/click/issues
  53. - Test status: https://dev.azure.com/pallets/click/_build
  54. - Official chat: https://discord.gg/t6rrQZH