Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Python composable command line interface toolkit

License

NotificationsYou must be signed in to change notification settings

pallets/click

Click

Click is a Python package for creating beautiful command line interfacesin a composable way with as little code as necessary. It's the "CommandLine Interface Creation Kit". It's highly configurable but comes withsensible defaults out of the box.

It aims to make the process of writing command line tools quick and funwhile also preventing any frustration caused by the inability toimplement an intended CLI API.

Click in three points:

  • Arbitrary nesting of commands
  • Automatic help page generation
  • Supports lazy loading of subcommands at runtime

A Simple Example

importclick@click.command()@click.option("--count",default=1,help="Number of greetings.")@click.option("--name",prompt="Your name",help="The person to greet.")defhello(count,name):"""Simple program that greets NAME for a total of COUNT times."""for_inrange(count):click.echo(f"Hello,{name}!")if__name__=='__main__':hello()
$ python hello.py --count=3Your name: ClickHello, Click!Hello, Click!Hello, Click!

Donate

The Pallets organization develops and supports Click and other popularpackages. In order to grow the community of contributors and users, andallow the maintainers to devote more time to the projects,pleasedonate today.

Contributing

See ourdetailed contributing documentation for many ways tocontribute, including reporting issues, requesting features, asking or answeringquestions, and making PRs.


[8]ページ先頭

©2009-2025 Movatter.jp