Skip to main content

A bunch of useful click parameter types

Project description

click-params

Pypi version Coverage Status Documentation Status License Apache 2

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

pip install click-params

click-params starts working from python 3.6. It has a few dependencies:

Usage

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)
$ 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/.

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

click-params-0.3.0.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

click_params-0.3.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file click-params-0.3.0.tar.gz.

File metadata

  • Download URL: click-params-0.3.0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.8.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.7

File hashes

Hashes for click-params-0.3.0.tar.gz
Algorithm Hash digest
SHA256 44be00bccc569c864cccc2d3012de73ca428a58f44f23dbc4ced32f53109f6c1
MD5 eedc70d28eb8ec9b8b6cc148995d8c3d
BLAKE2b-256 5a0969855205a820a3a57e2265a6976d75903821547f4b9905171f2635285fa2

See more details on using hashes here.

File details

Details for the file click_params-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: click_params-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.8.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.7

File hashes

Hashes for click_params-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9fd5a7a3787cfa40ea09e4419c327078690fc3f2385cc5641f890ee13b049d4
MD5 ec2f7b0eab94a951b8b3fb3d05d4982a
BLAKE2b-256 d80cd64afe189950e0cc8b9bc921cfccfd8137df531440a9d108dbacfaa0d723

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