Skip to main content

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

clicktypes-0.0.6.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

clicktypes-0.0.6-py2.py3-none-any.whl (9.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file clicktypes-0.0.6.tar.gz.

File metadata

  • Download URL: clicktypes-0.0.6.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for clicktypes-0.0.6.tar.gz
Algorithm Hash digest
SHA256 ff932963979658833b175ee82432f5bd4fbbc30bbdaeca96384cd19315857f22
MD5 0230ad9fe7b62996c4bf31ff513b0afe
BLAKE2b-256 4467599b8ec10edf6024c35ab5a5f4c33fd4fea03ee2d68556088f0af24b2edf

See more details on using hashes here.

File details

Details for the file clicktypes-0.0.6-py2.py3-none-any.whl.

File metadata

  • Download URL: clicktypes-0.0.6-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for clicktypes-0.0.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 fda7c75c2bcad16f6dc12f654f94c3b9e4325a439a70b4a2710d44e9e879da73
MD5 6d1138224fadc77b97f6a2b32a31f19a
BLAKE2b-256 ef57bff0596a0f9efd4051844026fcb5e2e6784e0c5d786f30f5ccd2a85c79f5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page