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.1.2.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

click_params-0.1.2-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: click-params-0.1.2.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.6.10 Linux/5.4.0-72-generic

File hashes

Hashes for click-params-0.1.2.tar.gz
Algorithm Hash digest
SHA256 249e7dfe958046aa2badffe9a5d3d63ac5f96a31716cb3d04af98c13c92b2eff
MD5 02ec6e5c7717a58b95359ec3729a7eac
BLAKE2b-256 89df9ff57300b1eaf4e4bd996b8c36ae6f318bd2ae2eda3fdb13530aaec442b5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: click_params-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.6.10 Linux/5.4.0-72-generic

File hashes

Hashes for click_params-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 72fd5c2d8ac997272edbc066011920bc6fac2e305c8af8c97aa39df894eef70b
MD5 215618d0a385c04b11f9144cb9748abb
BLAKE2b-256 c4a98f1ac8e650fadd5a2aefcce6b4507f48995ad13d8d6c6092eccd1927b920

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