Skip to content

Validate

Validate email, URL, phone, IP, UUID, credit card, and JSON Schema.

7 modules

ModuleDescription
Validate Credit CardValidate credit card number using Luhn algorithm
Validate EmailValidate email address format
Validate IPValidate IPv4 or IPv6 address format
Validate JSON SchemaValidate JSON data against a JSON Schema
Validate PhoneValidate phone number format
Validate URLValidate URL format and structure
Validate UUIDValidate UUID format and version

Modules

Validate Credit Card

validate.credit_card

Validate credit card number using Luhn algorithm

Parameters:

NameTypeRequiredDefaultDescription
card_numberstringYes-Credit card number to validate

Output:

FieldTypeDescription
validbooleanCredit card number to validate
card_typestringWhether the card number is valid
maskedstringWhether the card number is valid
luhn_validbooleanMasked card number (****1234)

Validate Email

validate.email

Validate email address format

Parameters:

NameTypeRequiredDefaultDescription
emailstringYes-Email address to validate

Output:

FieldTypeDescription
validbooleanEmail address to validate
emailstringWhether the email is valid
local_partstringWhether the email is valid
domainstringThe validated email

Validate IP

validate.ip

Validate IPv4 or IPv6 address format

Parameters:

NameTypeRequiredDefaultDescription
ipstringYes-IP address to validate
versionstringNoanyIP address to validate

Output:

FieldTypeDescription
validbooleanWhether the IP address is valid
ipstringWhether the IP address is valid
versionstringWhether the IP address is valid
is_privatebooleanThe validated IP address
is_loopbackbooleanDetected IP version (v4 or v6)

Validate JSON Schema

validate.json_schema

Validate JSON data against a JSON Schema

Parameters:

NameTypeRequiredDefaultDescription
datatextYes-JSON data to validate (string or object)
schematextYes-JSON data to validate (string or object)

Output:

FieldTypeDescription
validbooleanJSON Schema to validate against
errorsarrayWhether the data is valid
error_countnumberWhether the data is valid

Validate Phone

validate.phone

Validate phone number format

Parameters:

NameTypeRequiredDefaultDescription
phonestringYes-Phone number to validate
regionstringNointernationalPhone number to validate

Output:

FieldTypeDescription
validbooleanWhether the phone number is valid
phonestringWhether the phone number is valid
normalizedstringWhether the phone number is valid
regionstringThe validated phone number

Validate URL

validate.url

Validate URL format and structure

Parameters:

NameTypeRequiredDefaultDescription
urlstringYes-URL to validate
require_httpsbooleanNoFalseURL to validate

Output:

FieldTypeDescription
validbooleanOnly accept HTTPS URLs
urlstringWhether the URL is valid
schemestringWhether the URL is valid
hoststringThe validated URL
portnumberURL scheme (http, https, etc)
pathstringHost/domain name
querystringPort number if specified

Validate UUID

validate.uuid

Validate UUID format and version

Parameters:

NameTypeRequiredDefaultDescription
uuidstringYes-UUID to validate
versionnumberNo0UUID to validate

Output:

FieldTypeDescription
validbooleanExpected UUID version (1-5, or 0 for any)
uuidstringWhether the UUID is valid
versionnumberWhether the UUID is valid
variantstringThe validated UUID

Released under the Apache 2.0 License.