phone-number-validator


Namephone-number-validator JSON
Version 1.0.2 PyPI version JSON
download
home_pagehttps://github.com/ashutoshkrris/phone-number-validator
SummaryValidate Phone Numbers using NumLookupAPI
upload_time2023-05-05 12:27:10
maintainer
docs_urlNone
authorAshutosh Krishna
requires_python>=3.8,<4.0
licenseApache-2.0
keywords phone-number validator validate phone-number-validator everapi numlookupapi
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Phone Number Validator

The Phone Number Validator package provides a simple way to validate phone numbers using the NumLookupAPI.

## Installation
You can install the package using pip:

```bash
pip install phone-number-validator
```

## Usage
To use the package, you must first obtain an API key from NumLookupAPI. Once you have an API key, you can create a PhoneNumberValidator instance and use its validate method to validate a phone number:

```python
from phone_number_validator.validator import PhoneNumberValidator

validator = PhoneNumberValidator(api_key="YOUR_API_KEY")

# Example 1: Valid phone number without country code
is_valid1 = validator.validate("+16502530000")
print(is_valid1)  # Returns True

# Example 2: Valid phone number with country code
is_valid2 = validator.validate("6502530000", "US")
print(is_valid2)  # Returns True

# Example 3: Invalid phone number without country code
is_valid3 = validator.validate("+11234567890")
print(is_valid3)  # Returns False

# Example 4: Invalid phone number with country code
is_valid4 = validator.validate("1234567890", "US")
print(is_valid4)  # Returns False
```
The validate method takes a phone number and an optional country code as arguments. If the phone number is valid, the method returns True. If the phone number is invalid, the method returns False.

If the API call fails for any reason, the method raises an HTTPError exception.
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ashutoshkrris/phone-number-validator",
    "name": "phone-number-validator",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "phone-number,validator,validate,phone-number-validator,everapi,numlookupapi",
    "author": "Ashutosh Krishna",
    "author_email": "ashutoshbritish@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/13/60/eee490afadec7753e7ea3e4c5c93d6e8af23c70d71f9bddb37179222ea54/phone_number_validator-1.0.2.tar.gz",
    "platform": null,
    "description": "# Phone Number Validator\n\nThe Phone Number Validator package provides a simple way to validate phone numbers using the NumLookupAPI.\n\n## Installation\nYou can install the package using pip:\n\n```bash\npip install phone-number-validator\n```\n\n## Usage\nTo use the package, you must first obtain an API key from NumLookupAPI. Once you have an API key, you can create a PhoneNumberValidator instance and use its validate method to validate a phone number:\n\n```python\nfrom phone_number_validator.validator import PhoneNumberValidator\n\nvalidator = PhoneNumberValidator(api_key=\"YOUR_API_KEY\")\n\n# Example 1: Valid phone number without country code\nis_valid1 = validator.validate(\"+16502530000\")\nprint(is_valid1)  # Returns True\n\n# Example 2: Valid phone number with country code\nis_valid2 = validator.validate(\"6502530000\", \"US\")\nprint(is_valid2)  # Returns True\n\n# Example 3: Invalid phone number without country code\nis_valid3 = validator.validate(\"+11234567890\")\nprint(is_valid3)  # Returns False\n\n# Example 4: Invalid phone number with country code\nis_valid4 = validator.validate(\"1234567890\", \"US\")\nprint(is_valid4)  # Returns False\n```\nThe validate method takes a phone number and an optional country code as arguments. If the phone number is valid, the method returns True. If the phone number is invalid, the method returns False.\n\nIf the API call fails for any reason, the method raises an HTTPError exception.",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Validate Phone Numbers using NumLookupAPI",
    "version": "1.0.2",
    "project_urls": {
        "Homepage": "https://github.com/ashutoshkrris/phone-number-validator",
        "Repository": "https://github.com/ashutoshkrris/phone-number-validator"
    },
    "split_keywords": [
        "phone-number",
        "validator",
        "validate",
        "phone-number-validator",
        "everapi",
        "numlookupapi"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "be7db2c183bf25e1b88e7171eef7902cee93dfc43b219a4405bfca20a4bfb801",
                "md5": "a64e5c309560751a5a42d19b2c4e9cfa",
                "sha256": "fdd31c04e50856024576bc8f5c0e23586684773e1179123f78164c0199fa8d5b"
            },
            "downloads": -1,
            "filename": "phone_number_validator-1.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a64e5c309560751a5a42d19b2c4e9cfa",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 2878,
            "upload_time": "2023-05-05T12:26:46",
            "upload_time_iso_8601": "2023-05-05T12:26:46.872215Z",
            "url": "https://files.pythonhosted.org/packages/be/7d/b2c183bf25e1b88e7171eef7902cee93dfc43b219a4405bfca20a4bfb801/phone_number_validator-1.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1360eee490afadec7753e7ea3e4c5c93d6e8af23c70d71f9bddb37179222ea54",
                "md5": "803ba2bd5e913e1827a48c7b298e0c33",
                "sha256": "ed0cc32e45b8416b998e130e9194aadeb84d65b56a36a60e2c3d6d0f597fc743"
            },
            "downloads": -1,
            "filename": "phone_number_validator-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "803ba2bd5e913e1827a48c7b298e0c33",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 2435,
            "upload_time": "2023-05-05T12:27:10",
            "upload_time_iso_8601": "2023-05-05T12:27:10.157379Z",
            "url": "https://files.pythonhosted.org/packages/13/60/eee490afadec7753e7ea3e4c5c93d6e8af23c70d71f9bddb37179222ea54/phone_number_validator-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-05 12:27:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ashutoshkrris",
    "github_project": "phone-number-validator",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "phone-number-validator"
}
        
Elapsed time: 0.08046s