# click-params
[![Pypi version](https://img.shields.io/pypi/v/click-params.svg)](https://pypi.org/project/click-params/)
![](https://github.com/click-contrib/click_params/workflows/CI/badge.svg)
[![Coverage Status](https://codecov.io/gh/click-contrib/click_params/branch/master/graphs/badge.svg?branch=master)](https://codecov.io/gh/click-contrib/click_params)
[![Documentation Status](https://readthedocs.org/projects/click_params/badge/?version=latest)](https://click-params.readthedocs.io/en/latest/?badge=latest)
[![License Apache 2](https://img.shields.io/hexpm/l/plug.svg)](http://www.apache.org/licenses/LICENSE-2.0)
[![Code Style](https://img.shields.io/badge/code%20style-black-black)](https://github.com/click-contrib/click_params)
A bunch of useful click parameter types.
## Why?
I often find myself wanting to use a click parameter able to handle list of strings, so I decide to put this in a library
and I ended adding more parameter types that can be useful for various scripts including network, mathematics and so on.
## Installation
```bash
pip install click-params
```
click-params starts working from **python 3.8**. It has a few dependencies:
- [click](https://click.palletsprojects.com/en/7.x/) >= 7.0
- [validators](https://validators.readthedocs.io/en/latest/)
- [deprecated](https://deprecated.readthedocs.io/en/latest/)
## Usage
```python
import click
from click_params import Ipv4AddressListParamType
@click.command()
@click.option('-a', '--addresses', help='list of ipv4 addresses', prompt='list of ipv4 addresses to reserve',
type=Ipv4AddressListParamType())
def pool(addresses):
click.echo('reserved ips:')
for ip in addresses:
click.echo(ip)
```
```bash
$ pool --addresses='192.168.1.1,192.168.1.14'
reserved ips:
192.168.1.1
192.168.1.14
```
You can change the default separator "," by passing it when initializing the parameter type.
## Documentation
Documentation is available at https://click-params.readthedocs.io/en/latest/.
Raw data
{
"_id": null,
"home_page": "https://click-params.readthedocs.io/en/stable",
"name": "click-params",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8.1,<4.0.0",
"maintainer_email": "",
"keywords": "click,params,validators,network,cli",
"author": "lewoudar",
"author_email": "lewoudar@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/0c/49/57e60d9e1b78fd21fbaeda0725ac311595c35d8682dace6b71b274a43b90/click_params-0.5.0.tar.gz",
"platform": null,
"description": "# click-params\n\n[![Pypi version](https://img.shields.io/pypi/v/click-params.svg)](https://pypi.org/project/click-params/)\n![](https://github.com/click-contrib/click_params/workflows/CI/badge.svg)\n[![Coverage Status](https://codecov.io/gh/click-contrib/click_params/branch/master/graphs/badge.svg?branch=master)](https://codecov.io/gh/click-contrib/click_params)\n[![Documentation Status](https://readthedocs.org/projects/click_params/badge/?version=latest)](https://click-params.readthedocs.io/en/latest/?badge=latest)\n[![License Apache 2](https://img.shields.io/hexpm/l/plug.svg)](http://www.apache.org/licenses/LICENSE-2.0)\n[![Code Style](https://img.shields.io/badge/code%20style-black-black)](https://github.com/click-contrib/click_params)\n\nA bunch of useful click parameter types.\n\n## Why?\n\nI often find myself wanting to use a click parameter able to handle list of strings, so I decide to put this in a library\nand I ended adding more parameter types that can be useful for various scripts including network, mathematics and so on.\n\n\n## Installation\n\n```bash\npip install click-params\n```\n\nclick-params starts working from **python 3.8**. It has a few dependencies:\n- [click](https://click.palletsprojects.com/en/7.x/) >= 7.0\n- [validators](https://validators.readthedocs.io/en/latest/)\n- [deprecated](https://deprecated.readthedocs.io/en/latest/)\n\n## Usage\n\n```python\nimport click\nfrom click_params import Ipv4AddressListParamType\n\n@click.command()\n@click.option('-a', '--addresses', help='list of ipv4 addresses', prompt='list of ipv4 addresses to reserve',\n type=Ipv4AddressListParamType())\ndef pool(addresses):\n click.echo('reserved ips:')\n for ip in addresses:\n click.echo(ip)\n```\n\n```bash\n$ pool --addresses='192.168.1.1,192.168.1.14'\nreserved ips:\n192.168.1.1\n192.168.1.14\n```\n\nYou can change the default separator \",\" by passing it when initializing the parameter type.\n\n## Documentation\n\nDocumentation is available at https://click-params.readthedocs.io/en/latest/.\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "A bunch of useful click parameter types",
"version": "0.5.0",
"project_urls": {
"Bug Tracker": "https://github.com/click-contrib/click_params/issues",
"Documentation": "https://click-params.readthedocs.io/en/stable",
"Homepage": "https://click-params.readthedocs.io/en/stable",
"Repository": "https://github.com/click-contrib/click_params"
},
"split_keywords": [
"click",
"params",
"validators",
"network",
"cli"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "cac7a04832e84f1c613194231a657612aee2e377d63a44a5847386c83c38bbd6",
"md5": "bfbad0b1a36e7321e1d27847b1f1f485",
"sha256": "bbb2efe44197ab896bffcb50f42f22240fb077e6756b568fbdab3e1700b859d6"
},
"downloads": -1,
"filename": "click_params-0.5.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "bfbad0b1a36e7321e1d27847b1f1f485",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8.1,<4.0.0",
"size": 13152,
"upload_time": "2023-11-23T11:54:29",
"upload_time_iso_8601": "2023-11-23T11:54:29.599521Z",
"url": "https://files.pythonhosted.org/packages/ca/c7/a04832e84f1c613194231a657612aee2e377d63a44a5847386c83c38bbd6/click_params-0.5.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0c4957e60d9e1b78fd21fbaeda0725ac311595c35d8682dace6b71b274a43b90",
"md5": "6ff6f6281a98db60406d75653b68ac63",
"sha256": "5fe97b9459781a3b43b84fe4ec0065193e1b0d5cf6dc77897fe20c31f478d7ff"
},
"downloads": -1,
"filename": "click_params-0.5.0.tar.gz",
"has_sig": false,
"md5_digest": "6ff6f6281a98db60406d75653b68ac63",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8.1,<4.0.0",
"size": 11097,
"upload_time": "2023-11-23T11:54:31",
"upload_time_iso_8601": "2023-11-23T11:54:31.315465Z",
"url": "https://files.pythonhosted.org/packages/0c/49/57e60d9e1b78fd21fbaeda0725ac311595c35d8682dace6b71b274a43b90/click_params-0.5.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-23 11:54:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "click-contrib",
"github_project": "click_params",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "click-params"
}