click-validators
Additional click parameter types are built on top of the validators library, providing a wide range of validation options for various data types, including email addresses, IP addresses, credit card numbers, and more. This package simplifies the process of adding robust validation to your Click-based CLI applications.
clicktypes.amex()clicktypes.base16()clicktypes.base32()clicktypes.base58()clicktypes.base64()clicktypes.bsc_address()clicktypes.btc_address()clicktypes.calling_code()clicktypes.card_number()clicktypes.country_code()clicktypes.cron()clicktypes.currency()clicktypes.cusip()clicktypes.diners()clicktypes.discover()clicktypes.domain()clicktypes.email()clicktypes.es_cif()clicktypes.es_doi()clicktypes.es_nie()clicktypes.es_nif()clicktypes.eth_address()clicktypes.fi_business_id()clicktypes.fi_ssn()clicktypes.fr_department()clicktypes.fr_ssn()clicktypes.hostname()clicktypes.iban()clicktypes.ind_aadhar()clicktypes.ind_pan()clicktypes.ipv4()clicktypes.ipv6()clicktypes.isin()clicktypes.jcb()clicktypes.mac_address()clicktypes.mastercard()clicktypes.md5()clicktypes.mir()clicktypes.ru_inn()clicktypes.sedol()clicktypes.sha1()clicktypes.sha224()clicktypes.sha256()clicktypes.sha384()clicktypes.sha512()clicktypes.slug()clicktypes.trx_address()clicktypes.unionpay()clicktypes.url()clicktypes.uuid()clicktypes.visa()
Install
pip install click-validators
for clicktypes.eth_address() validation, additional package eth-hash[pycryptodome]>=0.7.0 is required.
pip install click-validators[eth]
Usage
import the module clicktypes and use the validators as types in click commands.
import click
import clicktypes
@click.command(
help="validate email address",
)
@click.argument(
"email",
type=clicktypes.email(),
)
def main(email):
click.echo(f"valid {email=}")
if __name__ == "__main__":
main()
Example
$ main.py fu@bar.com
valid email='fu@bar.com'
$ main.py fu.bar.com
Usage: main.py [OPTIONS] EMAIL
Try 'main.py --help' for help.
Error: Invalid value for 'EMAIL': 'fu.bar.com'.
Dependencies
Metadata
Release files for click-validators 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| click_validators-0.2.1.tar.gz | 5.5 kB | Without provenance | Details for click_validators-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| click_validators-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for click_validators-0.2.1-py3-none-any.whl |
Total release size: 11.2 kB
Release files / click_validators-0.2.1.tar.gz
| Download URL | click_validators-0.2.1.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1cce6e8aabd1726e7d4b0efb64459fa3a4ec49a6f48f2e4d34b81b72525fbc77
|
|
BLAKE2b-256 checksum How to use checksums |
b2872364d1fd2edefbd47fca9d6ad59aca281d68b9ac193786ba641ca579b19d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.5 CPython/3.13.3 Linux/6.11.0-1012-azure
|
Release files / click_validators-0.2.1-py3-none-any.whl
| Download URL | click_validators-0.2.1-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7fb48a9172b847f5c44970933708341778ae08e7a5bf0fea00c7378338c021c5
|
|
BLAKE2b-256 checksum How to use checksums |
f7ba8deb20e7e33f74f2dcd564074346e6e18af7652137d2bc36130aa3086922
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.5 CPython/3.13.3 Linux/6.11.0-1012-azure
|
Security for click-validators 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.