Skip to main content

A library to validate vehicle and user details

Project description

Vehicle Form Validation Library

The library allows you to validate your form inputs using OOPS principles. It has cutomized fields like vehicle make, vehicle type etc also it provides liscence validations specific to country. In addtion to vehicles it provides user details validations.

Installation

Install the library with: pip install vehicle_form_validator

USAGE

from vehicle_form_validator import FieldValidator

Vehicle Number Validation

vehicle_number = "AB-07-8746" if FieldValidator.validate_vehicle_number(vehicle_number): print(f"'{vehicle_number}' is a valid vehicle number.") else: print(f"'{vehicle_number}' is an invalid vehicle number.")

Vehicle Type Validation

vehicle_type = "Car" if FieldValidator.validate_vehicle_type(vehicle_type): print(f"'{vehicle_type}' is a valid vehicle type.") else: print(f"'{vehicle_type}' is an invalid vehicle type.")

Vehicle Make Validation

vehicle_make = "Mahindra" if FieldValidator.validate_vehicle_make(vehicle_make): print(f"'{vehicle_make}' is a valid vehicle make.") else: print(f"'{vehicle_make}' is an invalid vehicle make.")

Vehicle Model Validation

vehicle_model = "XUV 700" if FieldValidator.validate_vehicle_model(vehicle_model): print(f"'{vehicle_model}' is a valid vehicle model.") else: print(f"'{vehicle_model}' is an invalid vehicle model.")

License Plate Validation (Ireland)

license_plate = "12-34ABC" if FieldValidator.validate_license_plate(license_plate, country_code="IE"): print(f"'{license_plate}' is a valid license plate for Ireland.") else: print(f"'{license_plate}' is an invalid license plate for Ireland.")

Phone Number Validation (Ireland)

phone_number = "+353123456789" if FieldValidator.validate_phone_number(phone_number, country_code="IE"): print(f"'{phone_number}' is a valid Irish phone number.") else: print(f"'{phone_number}' is an invalid Irish phone number.")

Email Validation

email = "test@example.com" if FieldValidator.validate_email(email): print(f"'{email}' is a valid email address.") else: print(f"'{email}' is an invalid email address.")

Password Validation

password = "Password123!" confirm_password = "Password123!" valid, message = FieldValidator.validate_password(password, confirm_password) if valid: print("Password is valid.") else: print(f"Password is invalid: {message}")

Full Name Validation

full_name = "John Doe" if FieldValidator.validate_full_name(full_name): print(f"'{full_name}' is a valid full name.") else: print(f"'{full_name}' is an invalid full name.")

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

vehicle_form_validator-1.0.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vehicle_form_validator-1.0.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file vehicle_form_validator-1.0.0.tar.gz.

File metadata

  • Download URL: vehicle_form_validator-1.0.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for vehicle_form_validator-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6f32a85f3ac2d1151ba4edb0bfbbd1259458aecb257c1581614c03e0b2407b6c
MD5 14e4b6cd25f9c18cd73a922b426623df
BLAKE2b-256 567363cdce711d983ecc2a6b23de4ce8b862cd5923d4f2ef42ee8ebf54673fde

See more details on using hashes here.

File details

Details for the file vehicle_form_validator-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for vehicle_form_validator-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b2f92b2cc1591ff8657ec60c00d960634743416835a02bd0b84a22d8b64bca59
MD5 dab0ad6a650520e79bd28d663c172f70
BLAKE2b-256 00aea2ebc3756d97a49b47d159a44062a5242cbe8ba11dd7f7abf58a266af2fc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page