Additional parameter types for the "click" module that I find useful.
Project description
clicktypes
Additional types for the click module that I find useful.
For a list of available types check the README file from the module.
Installation
Install from PyPI:
## 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:
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:
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file clicktypes-0.0.7.tar.gz
.
File metadata
- Download URL: clicktypes-0.0.7.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1927b37eff13501afd1649605bc74ba530ba1038d728e27977029a4163b035a |
|
MD5 | 113440d62e629435b906a81b26b51533 |
|
BLAKE2b-256 | fe07765047d98ec276aba9bfb9a10b227e30e3c7a7a0d1008faf7d671d2b7e29 |
File details
Details for the file clicktypes-0.0.7-py2.py3-none-any.whl
.
File metadata
- Download URL: clicktypes-0.0.7-py2.py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bef4dc37ca76e02d190c2af458ee3356aa42d8a6f055cbd734b9e3598915c258 |
|
MD5 | 3a960829fc41da6211b13f285e99a336 |
|
BLAKE2b-256 | d1ede30af8566ddfb6e7105efd9c69f93396e5e52f4ab53a8eeb45da59d75c02 |