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.
- Phone Number Validation: Supports Nigerian phone numbers in local and international formats.
- Date Validation: Validates dates in the
DD/MM/YYYYformat, including leap years. - URL Validation: Checks for valid domain structures, including
http,https, andwwwprefixes.
Usage
First, import the DataValidator class:
from DataValidityCheck import DataValidator
validator = DataValidator()
Email Validation
print(validator.validate_email("user@example.com")) # True
print(validator.validate_email("invalid-email")) # False
Phone Number Validation
print(validator.validate_phone("08123456789")) # True
print(validator.validate_phone("+2348123456789")) # True
print(validator.validate_phone("123456")) # False
Date Validation
print(validator.validate_date("27/02/2024")) # True
print(validator.validate_date("31/04/2023")) # False (April has 30 days)
URL Validation
print(validator.validate_url("https://www.google.com")) # True
print(validator.validate_url("htp://invalid.com")) # False
Contributing
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch (
feature-branch). - Commit your changes.
- 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file datavaliditycheck-0.0.3.tar.gz.
File metadata
- Download URL: datavaliditycheck-0.0.3.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
698c16d658fdb7b6932c096ac01b064b85d2e14afd64b8df01f0ff0c74b78cfb
|
|
| MD5 |
e8f014592044cc373b6a1ee399868f69
|
|
| BLAKE2b-256 |
83dbfcf820393d7c1b6439f2398e91f20d87ce95243d076f6ca30fbc728ef8f5
|
File details
Details for the file datavaliditycheck-0.0.3-py2.py3-none-any.whl.
File metadata
- Download URL: datavaliditycheck-0.0.3-py2.py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9fa1c3fa9777ab756bc8659784298cbdd4d4090a80a47de1508122633831a84d
|
|
| MD5 |
b6470ce518fa380db40a8e7f9f3ef13a
|
|
| BLAKE2b-256 |
b87fbf92e27de880266285750e3ff59e3e36d8b4ecf953815383431175afc7bb
|