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

Uploaded Source

Built Distribution

click_params-0.4.1-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: click_params-0.4.1.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.7.16 Linux/6.1.0-1004-oem

File hashes

Hashes for click_params-0.4.1.tar.gz
Algorithm Hash digest
SHA256 3c8d64b4bcea783385b42924f9ff2932d619b8da4bc946b0367d5896f72fba18
MD5 bd14833673b471056e1d7e0673d85d18
BLAKE2b-256 bae507f2619c406d5bf3051fd0977c4f3fdf8851f5be2b35df87c013fa8e1699

See more details on using hashes here.

File details

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

File metadata

  • Download URL: click_params-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.7.16 Linux/6.1.0-1004-oem

File hashes

Hashes for click_params-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 54020e2e377720866a5bb3728b45f8823e0e4ffb85633983c78e6d66fd90b6f6
MD5 eb25b038026f69a6c255a77fc6fde241
BLAKE2b-256 5be1bd60c9df2390858723c5978269805c7712ef98c03fe04a562379863151c4

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