click_types package

Python package that provides custom click types.

Submodules

click_types.ansible module

Module for custom click types regarding to ansible.

class click_types.ansible.AnsibleVaultParamType(vault: str, secret: str, path: str)[source]

Bases: click.types.ParamType

Provide a custom click type for ansible vaults.

This custom click type provides managing passed values in a given vault.
  • decrypt vault

  • save passed value

  • encrypt vault

convert(value, param, ctx)[source]

Open vault and save vaule at the given path.

Parameters
  • value (str) – the value passed

  • param (str) – the parameter that we declared

  • ctx (str) – context of the command

Returns

the passed value as a checked semver

Return type

str

name: str = 'vault'

the descriptive name of this type

path

alias of str

secret

alias of str

vault

alias of str

click_types.coding module

Module for custom click types regarding to development.

class click_types.coding.SemVerParamType[source]

Bases: click.types.ParamType

Provide a custom click type for semantic versions.

This custom click type provides validity checks for semantic versions.

convert(value, param, ctx)[source]

Converts the value from string into semver type.

This method takes a string and check if this string belongs to semantic verstion definition. If the test is passed the value will be returned. If not a error message will be prompted.

Parameters
  • value (str) – the value passed

  • param (str) – the parameter that we declared

  • ctx (str) – context of the command

Returns

the passed value as a checked semver

Return type

str

name: str = 'semver'

the descriptive name of this type

click_types.net module

Module for custom click types regarding to network.

class click_types.net.CIDRParamType[source]

Bases: click.types.ParamType

Provide a custom click type for network cidr handling.

This custom click type provides validity check for network cidrs. Both ip version (v4 and v6) are supported.

convert(value, param, ctx)[source]

Converts the value from string into cidr type.

This method takes a string and check if this string belongs to ipv4 or ipv6 cidr definition. If the test is passed the value will be returned. If not a error message will be prompted.

Parameters
  • value (str) – the value passed

  • param (str) – the parameter that we declared

  • ctx (str) – context of the command

Returns

the passed value as a checked cidr

Return type

int

name: str = 'cidr'

the descriptive name of this type

class click_types.net.VlanIDParamType[source]

Bases: click.types.ParamType

Provide a custom click type for vlan id handling.

This custom click type provides validity checks for vlan ids according to IEEE 802.1Q standard.

convert(value, param, ctx)[source]

Converts the value from string into semver type.

This method tages a string and check if this string belongs to semantic verstion definition. If the test is passed the value will be returned. If not a error message will be prompted.

Parameters
  • value (str) – the value passed

  • param (str) – the parameter that we declared

  • ctx (str) – context of the command

Returns

the passed value as a checked vlan id

Return type

int

name: str = 'vlanid'

the descriptive name of this type