click-params-0.4.1
توضیحات
A bunch of useful click parameter types
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | click-params-0.4.1 |
| نام | click-params |
| نسخه کتابخانه | 0.4.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | lewoudar |
| ایمیل نویسنده | lewoudar@gmail.com |
| آدرس صفحه اصلی | https://click-params.readthedocs.io/en/stable |
| آدرس اینترنتی | https://pypi.org/project/click-params/ |
| مجوز | Apache-2.0 |
# click-params
[](https://pypi.org/project/click-params/)

[](https://codecov.io/gh/click-contrib/click_params)
[](https://click-params.readthedocs.io/en/latest/?badge=latest)
[](http://www.apache.org/licenses/LICENSE-2.0)
[](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.7**. It has a few dependencies:
- [click](https://click.palletsprojects.com/en/7.x/) >= 7.0
- [validators](https://validators.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/.
نیازمندی
| مقدار | نام |
|---|---|
| >=7.0,<9.0 | click |
| >=0.20,<0.21 | validators |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7,<4.0 | Python |
نحوه نصب
نصب پکیج whl click-params-0.4.1:
pip install click-params-0.4.1.whl
نصب پکیج tar.gz click-params-0.4.1:
pip install click-params-0.4.1.tar.gz