clicktypes-0.0.7
توضیحات
Additional parameter types for the "click" module that I find useful.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | clicktypes-0.0.7 |
| نام | clicktypes |
| نسخه کتابخانه | 0.0.7 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | gbe0 |
| ایمیل نویسنده | python@gbe0.com |
| آدرس صفحه اصلی | https://github.com/python-modules/clicktypes |
| آدرس اینترنتی | https://pypi.org/project/clicktypes/ |
| مجوز | MIT |
# clicktypes
Additional types for the [click](https://pypi.org/project/click/) module that I find useful.
For a list of available types check the [README](https://github.com/python-modules/clicktypes/blob/master/clicktypes/README.md) file from the module.
## Installation
Install from PyPI:
```python
## Python 3
python3 -m pip install clicktypes
## PyPy3
pypy3 -m pip install clicktypes
```
## Examples
The following are some examples. For complete examples check the appropriate README.
### Networking
If you accept an IP address parameter:
```python
from clicktypes.network import IPAddressParam
@click.argument(
'ip',
nargs = -1,
required = True,
type = IPAddressParam(),
)
```
This will validate the IP or IP's provided are IPv4 or IPv6 addresses and return them as an `IPv4Address` or `IPv6Address` object.
### Web
If you accept an email address parameter:
```python
from clicktypes.web import EmailParam
@click.argument(
'email',
nargs = -1,
required = True,
type = EmailParam(),
)
```
This will validate the email address provided matches an approved regex and it will convert it to lowercase.
نیازمندی
| مقدار | نام |
|---|---|
| - | click |
| - | validators |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >= 3.6 | Python |
نحوه نصب
نصب پکیج whl clicktypes-0.0.7:
pip install clicktypes-0.0.7.whl
نصب پکیج tar.gz clicktypes-0.0.7:
pip install clicktypes-0.0.7.tar.gz