{"id":13493979,"url":"https://github.com/click-contrib/click-option-group","last_synced_at":"2025-10-21T20:49:25.489Z","repository":{"id":39633132,"uuid":"224924436","full_name":"click-contrib/click-option-group","owner":"click-contrib","description":"Option groups missing in Click","archived":false,"fork":false,"pushed_at":"2024-09-03T22:54:04.000Z","size":130,"stargazers_count":103,"open_issues_count":8,"forks_count":14,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-09-09T14:21:28.437Z","etag":null,"topics":["cli","click","click-contrib","python","python-cli","python-click"],"latest_commit_sha":null,"homepage":"https://click-option-group.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/click-contrib.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-29T21:29:39.000Z","updated_at":"2024-09-02T08:48:00.000Z","dependencies_parsed_at":"2023-01-31T11:31:23.676Z","dependency_job_id":"575342b7-d10a-46c0-b385-da9ab8f625ec","html_url":"https://github.com/click-contrib/click-option-group","commit_stats":{"total_commits":150,"total_committers":10,"mean_commits":15.0,"dds":"0.15333333333333332","last_synced_commit":"0650c78e34fa029f01a090ae04bb77ff59d392df"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/click-contrib%2Fclick-option-group","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/click-contrib%2Fclick-option-group/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/click-contrib%2Fclick-option-group/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/click-contrib%2Fclick-option-group/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/click-contrib","download_url":"https://codeload.github.com/click-contrib/click-option-group/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222382378,"owners_count":16975376,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","click","click-contrib","python","python-cli","python-click"],"created_at":"2024-07-31T19:01:20.596Z","updated_at":"2025-10-21T20:49:20.432Z","avatar_url":"https://github.com/click-contrib.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# click-option-group\n\n[![PyPI version](https://img.shields.io/pypi/v/click-option-group.svg)](https://pypi.python.org/pypi/click-option-group)\n[![Build status](https://travis-ci.org/click-contrib/click-option-group.svg?branch=master)](https://travis-ci.org/click-contrib/click-option-group)\n[![Coverage Status](https://coveralls.io/repos/github/click-contrib/click-option-group/badge.svg?branch=master)](https://coveralls.io/github/click-contrib/click-option-group?branch=master)\n![Supported Python versions](https://img.shields.io/pypi/pyversions/click-option-group.svg)\n[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)\n\n\n**click-option-group** is a Click-extension package that adds option groups\nmissing in [Click](https://github.com/pallets/click/).\n\n## Aim and Motivation\n\nClick is a package for creating powerful and beautiful command line interfaces (CLI) in Python,\nbut it has no the functionality for creating option groups.\n\nOption groups are convenient mechanism for logical structuring CLI, also it allows you to set\nthe specific behavior and set the relationship among grouped options (mutually exclusive options for example).\nMoreover, [argparse](https://docs.python.org/3/library/argparse.html) stdlib package contains this\nfunctionality out of the box.\n\nAt the same time, many Click users need this functionality.\nYou can read interesting discussions about it in the following issues:\n\n* [issue 257](https://github.com/pallets/click/issues/257)\n* [issue 373](https://github.com/pallets/click/issues/373)\n* [issue 509](https://github.com/pallets/click/issues/509)\n* [issue 1137](https://github.com/pallets/click/issues/1137)\n\nThe aim of this package is to provide group options with extensible functionality\nusing canonical and clean API (Click-like API as far as possible).\n\n## Quickstart\n\n### Installing\n\nInstall and update using pip:\n\n```bash\npip install -U click-option-group\n```\n\n### A Simple Example\n\nHere is a simple example how to use option groups in your Click-based CLI.\nJust use `optgroup` for declaring option groups by decorating\nyour command function in Click-like API style.\n\n```python\n# app.py\n\nimport click\nfrom click_option_group import optgroup, RequiredMutuallyExclusiveOptionGroup\n\n@click.command()\n@optgroup.group('Server configuration',\n                help='The configuration of some server connection')\n@optgroup.option('-h', '--host', default='localhost', help='Server host name')\n@optgroup.option('-p', '--port', type=int, default=8888, help='Server port')\n@optgroup.option('-n', '--attempts', type=int, default=3, help='The number of connection attempts')\n@optgroup.option('-t', '--timeout', type=int, default=30, help='The server response timeout')\n@optgroup.group('Input data sources', cls=RequiredMutuallyExclusiveOptionGroup,\n                help='The sources of the input data')\n@optgroup.option('--tsv-file', type=click.File(), help='CSV/TSV input data file')\n@optgroup.option('--json-file', type=click.File(), help='JSON input data file')\n@click.option('--debug/--no-debug', default=False, help='Debug flag')\ndef cli(**params):\n    print(params)\n\nif __name__ == '__main__':\n    cli()\n```\n\n```bash\n$ python app.py --help\nUsage: app.py [OPTIONS]\n\nOptions:\n  Server configuration:           The configuration of some server connection\n    -h, --host TEXT               Server host name\n    -p, --port INTEGER            Server port\n    -n, --attempts INTEGER        The number of connection attempts\n    -t, --timeout INTEGER         The server response timeout\n  Input data sources: [mutually_exclusive, required]\n                                  The sources of the input data\n    --tsv-file FILENAME           CSV/TSV input data file\n    --json-file FILENAME          JSON input data file\n  --debug / --no-debug            Debug flag\n  --help                          Show this message and exit.\n```\n\n## Documentation\n\nhttps://click-option-group.readthedocs.io\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclick-contrib%2Fclick-option-group","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclick-contrib%2Fclick-option-group","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclick-contrib%2Fclick-option-group/lists"}