Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Easy and Powerful International Phone Number Validation with Country Detectio
mobile-validate is a Python package designed to streamline the process of validating international phone numbers and identifying their corresponding countries. It leverages a comprehensive library of country-specific regular expressions to ensure accurate and reliable results.
Key Features
Supported Countries
The module currently supports phone number validation for a wide range of countries, including:
Applications
This package offers a versatile solution for various applications, including:
Installation
The package can be easily installed using pip:
::
pip install mobile-validate
Usage
mobile-validate offers an intuitive API for phone number validation and country detection:
::
from mobile_validate.validator import valid_number
# Example: Valid Zimbabwe Mobile Number
phone_number = "+263771234567"
country = "Zimbabwe"
if valid_number(phone_number, country):
print(f"Valid {country} mobile number")
else:
print(f"Not a valid {country} number")
Checking which country a number is from
::
from mobile_validate.validator import get_country
number = "+31784773900"
country = get_country(number)
print(f"{number} is from {country}")
Checking Carrier provider
::
from mobile_validate.validator import get_provider
phone_number = "+44889073398"
provider = get_provider(phone_number)
print(provider)
Note
This package is under active development, and contributions are always welcome.
FAQs
Unknown package
We found that mobile-validate demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.