Skip to main content

A bunch of useful click parameter types

Project description

click-params

Pypi version Coverage Status Documentation Status License Apache 2 Code Style

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.8. 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.5.0.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

click_params-0.5.0-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file click_params-0.5.0.tar.gz.

File metadata

  • Download URL: click_params-0.5.0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.11.3 Windows/10

File hashes

Hashes for click_params-0.5.0.tar.gz
Algorithm Hash digest
SHA256 5fe97b9459781a3b43b84fe4ec0065193e1b0d5cf6dc77897fe20c31f478d7ff
MD5 6ff6f6281a98db60406d75653b68ac63
BLAKE2b-256 0c4957e60d9e1b78fd21fbaeda0725ac311595c35d8682dace6b71b274a43b90

See more details on using hashes here.

File details

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

File metadata

  • Download URL: click_params-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.11.3 Windows/10

File hashes

Hashes for click_params-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bbb2efe44197ab896bffcb50f42f22240fb077e6756b568fbdab3e1700b859d6
MD5 bfbad0b1a36e7321e1d27847b1f1f485
BLAKE2b-256 cac7a04832e84f1c613194231a657612aee2e377d63a44a5847386c83c38bbd6

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