click-with-aliasing


Nameclick-with-aliasing JSON
Version 1.0.4 PyPI version JSON
download
home_pageNone
SummaryA library that allows you to add aliases to your Click group and commands.
upload_time2025-02-03 09:01:24
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseMIT License Copyright (c) 2025 Marcus Fredriksson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords click alias group command
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Click With Aliasing

![top language](https://img.shields.io/github/languages/top/marcusfrdk/click-with-aliasing)
![code size](https://img.shields.io/github/languages/code-size/marcusfrdk/click-with-aliasing)
![last commit](https://img.shields.io/github/last-commit/marcusfrdk/click-with-aliasing)
![issues](https://img.shields.io/github/issues/marcusfrdk/click-with-aliasing)
![contributors](https://img.shields.io/github/contributors/marcusfrdk/click-with-aliasing)
![PyPI](https://img.shields.io/pypi/v/click-with-aliasing)
![License](https://img.shields.io/github/license/marcusfrdk/click-with-aliasing)

This is a project that adds decorators that wraps the default `click.group` and `click.command` decorators with custom ones that support aliasing.

## Installation

You can install the package from [PyPI](https://pypi.org/project/click-with-aliasing/):

```bash
pip install click-with-aliasing
```

The package is available for Python 3.11 and newer.

## Usage

The package provides two decorators: `group` and `command`. They work exactly like the original `click.group` and `click.command` decorators, but they also support aliasing using the `aliases` argument.

Here is an example of how to use the `group` decorator:

```python
from click_with_aliasing import group
from .my_command import my_command

@group(name="my_group", aliases=['mg'])
def cli():
    """ My Click group """

cli.add_command(my_command)
```

This group works exactly like a normal `click.group`, but while using the CLI, you can use either `my_group` or `mg` to call the group.

The same works for the `command` decorator:

```python
from click_with_aliasing import command

@command(name="my_command", aliases=['mc'])
def my_command():
    """ My Click command """
    ...
```

Like the group, you can call the command using either `my_command` or `mc`.

You can now call the command using `mg mc` or any combination of the aliases.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "click-with-aliasing",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "click, alias, group, command",
    "author": null,
    "author_email": "Marcus Fredriksson <marcus@marcusfredriksson.com>",
    "download_url": "https://files.pythonhosted.org/packages/ca/00/be2708d308fd8c3807230edabc63427aafa4c1ba5762a45465901d43a8d6/click_with_aliasing-1.0.4.tar.gz",
    "platform": null,
    "description": "# Click With Aliasing\n\n![top language](https://img.shields.io/github/languages/top/marcusfrdk/click-with-aliasing)\n![code size](https://img.shields.io/github/languages/code-size/marcusfrdk/click-with-aliasing)\n![last commit](https://img.shields.io/github/last-commit/marcusfrdk/click-with-aliasing)\n![issues](https://img.shields.io/github/issues/marcusfrdk/click-with-aliasing)\n![contributors](https://img.shields.io/github/contributors/marcusfrdk/click-with-aliasing)\n![PyPI](https://img.shields.io/pypi/v/click-with-aliasing)\n![License](https://img.shields.io/github/license/marcusfrdk/click-with-aliasing)\n\nThis is a project that adds decorators that wraps the default `click.group` and `click.command` decorators with custom ones that support aliasing.\n\n## Installation\n\nYou can install the package from [PyPI](https://pypi.org/project/click-with-aliasing/):\n\n```bash\npip install click-with-aliasing\n```\n\nThe package is available for Python 3.11 and newer.\n\n## Usage\n\nThe package provides two decorators: `group` and `command`. They work exactly like the original `click.group` and `click.command` decorators, but they also support aliasing using the `aliases` argument.\n\nHere is an example of how to use the `group` decorator:\n\n```python\nfrom click_with_aliasing import group\nfrom .my_command import my_command\n\n@group(name=\"my_group\", aliases=['mg'])\ndef cli():\n    \"\"\" My Click group \"\"\"\n\ncli.add_command(my_command)\n```\n\nThis group works exactly like a normal `click.group`, but while using the CLI, you can use either `my_group` or `mg` to call the group.\n\nThe same works for the `command` decorator:\n\n```python\nfrom click_with_aliasing import command\n\n@command(name=\"my_command\", aliases=['mc'])\ndef my_command():\n    \"\"\" My Click command \"\"\"\n    ...\n```\n\nLike the group, you can call the command using either `my_command` or `mc`.\n\nYou can now call the command using `mg mc` or any combination of the aliases.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2025 Marcus Fredriksson\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.\n        ",
    "summary": "A library that allows you to add aliases to your Click group and commands.",
    "version": "1.0.4",
    "project_urls": {
        "Homepage": "https://github.com/marcusfrdk/click-with-aliasing",
        "Issues": "https://github.com/marcusfrdk/click-with-aliasing/issues",
        "Repository": "https://github.com/marcusfrdk/click-with-aliasing"
    },
    "split_keywords": [
        "click",
        " alias",
        " group",
        " command"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "e9e1c5bb5b712875a9e02e265f5f5db7707b7d0d98a5cb693252d5f9b36b496b",
                "md5": "e475277e7dfdae54389d3d6647ff79d7",
                "sha256": "479912e95821d9d876133eaae16f7af81d4ba4866d9bd0083ef0797530c80f39"
            },
            "downloads": -1,
            "filename": "click_with_aliasing-1.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e475277e7dfdae54389d3d6647ff79d7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 6292,
            "upload_time": "2025-02-03T09:01:23",
            "upload_time_iso_8601": "2025-02-03T09:01:23.050422Z",
            "url": "https://files.pythonhosted.org/packages/e9/e1/c5bb5b712875a9e02e265f5f5db7707b7d0d98a5cb693252d5f9b36b496b/click_with_aliasing-1.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ca00be2708d308fd8c3807230edabc63427aafa4c1ba5762a45465901d43a8d6",
                "md5": "b7fca6fe293524f75a5fdd25bead6c64",
                "sha256": "8c51ae9fda29d05a3b23d2bd59ef7bcaf7884c60b0b9b926ef8f5f1ee9ddcd9a"
            },
            "downloads": -1,
            "filename": "click_with_aliasing-1.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "b7fca6fe293524f75a5fdd25bead6c64",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 5054,
            "upload_time": "2025-02-03T09:01:24",
            "upload_time_iso_8601": "2025-02-03T09:01:24.689894Z",
            "url": "https://files.pythonhosted.org/packages/ca/00/be2708d308fd8c3807230edabc63427aafa4c1ba5762a45465901d43a8d6/click_with_aliasing-1.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-03 09:01:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "marcusfrdk",
    "github_project": "click-with-aliasing",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "click-with-aliasing"
}
        
Elapsed time: 0.55174s