You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

datavalidate

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

datavalidate

A simple datavalidator for validating email, phone numbers, dates, and URLs.

0.1
pipPyPI
Maintainers
1

datavalidate

Overview

Datavalidate is a Python package designed to efficiently validate various types of personal data, including:

  • Email addresses
  • Phone numbers
  • Dates
  • URLs

This package follows Object-Oriented Programming (OOP) principles, ensuring modularity, reusability, and easy integration into different projects.

Installation

Install the package using:

pip install datavalidator


---

## **Usage**

### **1️⃣ Import the Validator Class**
```python
from datavalidator.validator import DATAVALIDATOR

2️⃣ Validate an Email

data = "example@email.com"
validator = DataValidator(data)
print(validator.validate_email())  # Output: True

3️⃣ Validate a Phone Number

data = "+1-832-005-3034"
validator = DATAVALIDATOR(data)
print(validator.validate_phone()) # Output: True
To check if a number if froma particular contitnent , you can do this

data = "+234901245890"
validator = DATAVALIDATOR(data)
print(validator.african_numbers()) #output :True
repeat for other continents by simply calling the method continentname_numbers()

4️⃣ Validate a Date

data = "2024-02-1123"
validator = DATAVALIDATOR(data)
print(validator.validate_date())  # Output: True

5️⃣ Validate a URL

data = "https://google.com"
validator = DATAVALIDATOR(data)
print(validator.validate_url())  # Output: True

Running Tests

The package includes unit tests to ensure proper functionality. Run tests using:

pytest tests/

Contributing

Contributions are welcome! To contribute:

  • Fork the repository
  • Create a feature branch:
    git checkout -b featurebranch
    
  • Commit your changes:
    git commit -m "Added new feature"
    
  • Push to the branch:
    git push origin feature-branch
    
  • Open a Pull Request

License

This project is licensed under the MIT License.

Author

👤 OKOLI OGECHUKWU ABIMBOLA 📧 Email: okoliogechi74@gmail.com

---# Data-Epic-data-validator-ogechukwu-okoli

data-validator-ogechukw-okoli

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts