Skip to main content

A Python package for validating various types of data.

Project description

DataValidityCheck - Data Validation Package

Overview

DataValidityCheck is a Python package designed to validate personal data, including emails, phone numbers, dates, and URLs. It provides robust validation methods to ensure data accuracy and compliance with common formats.

Table of Contents

Installation

To install DataValidityCheck, use:

pip install DataValidityCheck

Features

  • Email Validation: Ensures a valid email format with proper domain structure.
  • Phone Number Validation: Supports Nigerian phone numbers in local and international formats.
  • Date Validation: Validates dates in the DD/MM/YYYY format, including leap years.
  • URL Validation: Checks for valid domain structures, including http://, https://, and www. prefixes.

Usage

First, import the DataValidator class:

from DataValidityCheck import DataValidator

validator = DataValidator()

Email Validation

print(validator.validate_email("user@example.com"))  # Valid email address
print(validator.validate_email("invalid-email"))  # Invalid email format, ensure it follows example "example@domain.com."

Phone Number Validation

print(validator.validate_phone("08123456789"))  # Valid phone number
print(validator.validate_phone("+2348123456789"))  # Valid phone number
print(validator.validate_phone("123456"))  # Invalid phone number format

Date Validation

print(validator.validate_date("29/02/2024"))  # Valid date (Leap year)
print(validator.validate_date("31/04/2023"))  # Invalid date (April has 30 days)

URL Validation

print(validator.validate_url("https://www.google.com"))  # Valid URL
print(validator.validate_url("htp://invalid.com"))  # Invalid URL format

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository.
  2. Create a new branch (feature-branch).
  3. Commit your changes.
  4. Submit a pull request.

Ensure you run tests before submitting:

pytest tests/

Author

Olajide Oluwafemi Richard

License

This package is open-source and available under the MIT License.

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

datavaliditycheck-0.0.4.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

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

datavaliditycheck-0.0.4-py2.py3-none-any.whl (4.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file datavaliditycheck-0.0.4.tar.gz.

File metadata

  • Download URL: datavaliditycheck-0.0.4.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.0

File hashes

Hashes for datavaliditycheck-0.0.4.tar.gz
Algorithm Hash digest
SHA256 92131e143cf1dd67e3f4d2294ee803bb8ce6910667e3c7458cc864549d135f2b
MD5 b73e2f8ddd7b0182263607c6e5cf4025
BLAKE2b-256 93232afc1a0f64d9c362a92446c61027cad26509e208fe0db4fd2af93558ad58

See more details on using hashes here.

File details

Details for the file datavaliditycheck-0.0.4-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for datavaliditycheck-0.0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1044b1e4eef35aca64e4f68977c1f008b854b395b1052bb4bfc0ecca9d391551
MD5 241e91c1009f276780d47f94ca6c22de
BLAKE2b-256 248f433d72b53004b3f2f7a80f94215d8eec47057211384b514c5d038b4dedff

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