{"library":"more-click","title":"More Click","description":"More Click (more-click) is a Python library, currently at version 0.1.3, that provides implementations of common Command Line Interface (CLI) patterns built on top of the popular Click framework. It offers pre-defined options, web application integration utilities, and other conveniences to reduce boilerplate when developing Click-based CLIs. The library is actively maintained, with a focus on enhancing existing Click applications.","language":"python","status":"active","last_verified":"Thu Apr 16","install":{"commands":["pip install more-click"],"cli":null},"imports":["from more_click import verbose_option","from more_click import make_web_command","from more_click import host_option","from more_click import port_option","from more_click import run_app"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import click\nfrom more_click import make_web_command, verbose_option\n\n# Example of a simple web command using more-click's utility\nweb_command = make_web_command('my_package.wsgi:app') # Replace 'my_package.wsgi:app' with your actual Flask app import path\n\n@click.group()\ndef cli():\n    pass\n\n@cli.command()\n@verbose_option\n@click.option('--custom-flag', is_flag=True, help='A custom flag.')\ndef my_tool(verbose: bool, custom_flag: bool):\n    \"\"\"A command demonstrating more-click options and custom logic.\"\"\"\n    if verbose:\n        click.echo(\"Verbose mode enabled.\")\n    if custom_flag:\n        click.echo(\"Custom flag enabled.\")\n    click.echo(\"Running my_tool.\")\n\ncli.add_command(web_command, name='web') # Add the web command to your CLI group\n\nif __name__ == '__main__':\n    # To run the web command: python your_cli.py web --host 0.0.0.0 --port 8000\n    # To run my_tool: python your_cli.py my-tool -v --custom-flag\n    cli()","lang":"python","description":"This quickstart demonstrates how to use `more-click`'s `make_web_command` to integrate a Flask application into a Click CLI, and how to use a pre-defined option like `verbose_option` alongside custom Click options. Remember to replace 'my_package.wsgi:app' with the actual path to your Flask application instance.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}