apiverve-phonenumbervalidator 1.1.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ from .apiClient import PhonenumbervalidatorAPIClient
@@ -0,0 +1,38 @@
1
+ import requests
2
+
3
+ class PhonenumbervalidatorAPIClient:
4
+ def __init__(self, api_key, secure=True):
5
+ """
6
+ Initialize the PhonenumbervalidatorAPIClient with the API key and secure flag
7
+ :param api_key: API key
8
+ :param secure: Deprecated. Always set to True
9
+ """
10
+
11
+ self.api_key = api_key
12
+ self.secure = secure
13
+ self.base_url = 'https://api.apiverve.com/v1/phonenumbervalidator'
14
+ self.headers = {
15
+ 'x-api-key': self.api_key,
16
+ 'auth-mode': 'pypi-package'
17
+ }
18
+
19
+ def execute(self, params=None):
20
+ """
21
+ Execute the API request
22
+ :param params: API parameters, if any
23
+ :return: API response
24
+ """
25
+
26
+ method = "GET"
27
+
28
+ try:
29
+ if method.upper() == 'POST':
30
+ response = requests.post(self.base_url, headers=self.headers, json=params)
31
+ else:
32
+ response = requests.get(self.base_url, headers=self.headers, params=params)
33
+
34
+ response.raise_for_status()
35
+ return response.json()
36
+ except requests.exceptions.RequestException as e:
37
+ print(f"An error occurred: {e}")
38
+ raise e
@@ -0,0 +1,3 @@
1
+ class PhonenumbervalidatorPhoneNumberValidatorAPIError(Exception):
2
+ """A custom exception for API errors"""
3
+ pass
@@ -0,0 +1,21 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name='apiverve_phonenumbervalidator',
5
+ version='1.1.4',
6
+ packages=find_packages(),
7
+ include_package_data=True,
8
+ install_requires=[
9
+ 'requests',
10
+ 'setuptools'
11
+ ],
12
+ description='Phone Number Validator is a simple tool for validating if a phone number is valid or not. It checks the phone number format and the country code to see if the phone number is valid.',
13
+ author='APIVerve',
14
+ author_email='hello@apiverve.com',
15
+ url='https://apiverve.com',
16
+ classifiers=[
17
+ 'Programming Language :: Python :: 3',
18
+ 'Operating System :: OS Independent',
19
+ ],
20
+ python_requires='>=3.6',
21
+ )
@@ -0,0 +1 @@
1
+ # Initialize test module
@@ -0,0 +1,19 @@
1
+ import unittest
2
+ from apiverve_phonenumbervalidator.apiClient import PhonenumbervalidatorAPIClient
3
+
4
+ class TestClient(unittest.TestCase):
5
+
6
+ def setUp(self):
7
+ self.api_key = 'test_api_key'
8
+ self.client = PhonenumbervalidatorAPIClient(self.api_key)
9
+
10
+ def test_get(self):
11
+ # Assuming there's an endpoint 'test_endpoint' for testing purposes
12
+ try:
13
+ response = self.client.get('test_endpoint')
14
+ self.assertIsInstance(response, dict)
15
+ except Exception as e:
16
+ self.fail(f"GET request failed with exception {e}")
17
+
18
+ if __name__ == '__main__':
19
+ unittest.main()
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 APIVerve, and Evlar LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,160 @@
1
+ Metadata-Version: 2.1
2
+ Name: apiverve-phonenumbervalidator
3
+ Version: 1.1.4
4
+ Summary: Phone Number Validator is a simple tool for validating if a phone number is valid or not. It checks the phone number format and the country code to see if the phone number is valid.
5
+ Author-email: APIVerve <hello@apiverve.com>
6
+ Project-URL: Homepage, https://apiverve.com?utm_source=pypi
7
+ Project-URL: Repository, https://github.com/apiverve/phonenumbervalidator.Python-API
8
+ Project-URL: Documentation, https://docs.apiverve.com/api/phonenumbervalidator?utm_source=pypi
9
+ Project-URL: Twitter, https://twitter.com/apivervehq
10
+ Keywords: phone validator,phone number validator,phone number validation,phone number validator api,phone number validation api
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: Financial and Insurance Industry
17
+ Classifier: Intended Audience :: Healthcare Industry
18
+ Classifier: Intended Audience :: Education
19
+ Classifier: Intended Audience :: Science/Research
20
+ Classifier: Intended Audience :: Information Technology
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Classifier: Topic :: Utilities
23
+ Classifier: Topic :: Scientific/Engineering
24
+ Classifier: Topic :: Education
25
+ Classifier: Topic :: Internet :: WWW/HTTP :: Indexing/Search
26
+ Classifier: Topic :: Internet :: WWW/HTTP :: Site Management
27
+ Classifier: Topic :: Internet :: WWW/HTTP
28
+ Classifier: Topic :: Software Development :: Libraries
29
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
30
+ Classifier: Topic :: Internet
31
+ Classifier: Topic :: Communications
32
+ Classifier: Topic :: Office/Business
33
+ Classifier: Topic :: Text Processing
34
+ Classifier: Topic :: Security
35
+ Classifier: Topic :: Database
36
+ Classifier: Topic :: Software Development :: Code Generators
37
+ Classifier: Topic :: Software Development :: Pre-processors
38
+ Classifier: Topic :: Software Development :: Quality Assurance
39
+ Classifier: Topic :: Software Development :: Testing
40
+ Classifier: Natural Language :: English
41
+ Requires-Python: >=3.12
42
+ Description-Content-Type: text/markdown
43
+ License-File: LICENSE
44
+
45
+ Phone Number Validator API
46
+ ============
47
+
48
+ Phone Number Validator is a simple tool for validating if a phone number is valid or not. It checks the phone number format and the country code to see if the phone number is valid.
49
+
50
+ ![Build Status](https://img.shields.io/badge/build-passing-green)
51
+ ![Code Climate](https://img.shields.io/badge/maintainability-B-purple)
52
+ ![Prod Ready](https://img.shields.io/badge/production-ready-blue)
53
+
54
+ This is a Python API Wrapper for the [Phone Number Validator API](https://apiverve.com/marketplace/api/phonenumbervalidator)
55
+
56
+ ---
57
+
58
+ ## Installation
59
+ pip install apiverve-phonenumbervalidator
60
+
61
+ ---
62
+
63
+ ## Configuration
64
+
65
+ Before using the phonenumbervalidator API client, you have to setup your account and obtain your API Key.
66
+ You can get it by signing up at [https://apiverve.com](https://apiverve.com)
67
+
68
+ ---
69
+
70
+ ## Usage
71
+
72
+ The Phone Number Validator API documentation is found here: [https://docs.apiverve.com/api/phonenumbervalidator](https://docs.apiverve.com/api/phonenumbervalidator).
73
+ You can find parameters, example responses, and status codes documented here.
74
+
75
+ ### Setup
76
+
77
+ ```
78
+ # Import the client module
79
+ from apiverve_phonenumbervalidator.apiClient import PhonenumbervalidatorAPIClient
80
+
81
+ # Initialize the client with your APIVerve API key
82
+ api = PhonenumbervalidatorAPIClient("[YOUR_API_KEY]")
83
+ ```
84
+
85
+ ---
86
+
87
+
88
+ ### Perform Request
89
+ Using the API client, you can perform requests to the API.
90
+
91
+ ###### Define Query
92
+
93
+ ```
94
+ query = { "number": "816-555-1017", "country": "us" }
95
+ ```
96
+
97
+ ###### Simple Request
98
+
99
+ ```
100
+ # Make a request to the API
101
+ result = api.execute(query)
102
+
103
+ # Print the result
104
+ print(result)
105
+ ```
106
+
107
+ ###### Example Response
108
+
109
+ ```
110
+ {
111
+ "status": "ok",
112
+ "error": null,
113
+ "data": {
114
+ "country": "US",
115
+ "detectedCountry": "US",
116
+ "countrycode": 1,
117
+ "numberNational": 8165551017,
118
+ "extension": null,
119
+ "isvalid": true,
120
+ "type": "fixed_line_or_mobile",
121
+ "formatted": {
122
+ "international": "+1 816-555-1017",
123
+ "national": "(816) 555-1017",
124
+ "rfc": "tel:+1-816-555-1017",
125
+ "e164": "+18165551017"
126
+ }
127
+ },
128
+ "code": 200
129
+ }
130
+ ```
131
+
132
+ ---
133
+
134
+ ## Customer Support
135
+
136
+ Need any assistance? [Get in touch with Customer Support](https://apiverve.com/contact).
137
+
138
+ ---
139
+
140
+ ## Updates
141
+ Stay up to date by following [@apiverveHQ](https://twitter.com/apiverveHQ) on Twitter.
142
+
143
+ ---
144
+
145
+ ## Legal
146
+
147
+ All usage of the APIVerve website, API, and services is subject to the [APIVerve Terms of Service](https://apiverve.com/terms) and all legal documents and agreements.
148
+
149
+ ---
150
+
151
+ ## License
152
+ Licensed under the The MIT License (MIT)
153
+
154
+ Copyright (&copy;) 2024 APIVerve, and Evlar LLC
155
+
156
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
157
+
158
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
159
+
160
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,11 @@
1
+ apiverve_phonenumbervalidator/__init__.py,sha256=rveF1v-NHB2VcC4S0WnRANHAEk46ji7f4B7t7VyXJbY,52
2
+ apiverve_phonenumbervalidator/apiClient.py,sha256=pXrTZtHhz-33fneULnuZAEdm39rEPwhT9-5JBPqhKoM,1250
3
+ apiverve_phonenumbervalidator/exceptions.py,sha256=vKD4uTLhwPFEZDpwrSFOeiZ7DUUxJ1d7lY0O-ZYbGYI,123
4
+ apiverve_phonenumbervalidator/setup.py,sha256=R-NBOHHV3qXMHxQ4q269X-0wpfQg_bbhiCWdlX2SLYI,712
5
+ apiverve_phonenumbervalidator/tests/__init__.py,sha256=w6P0tAvlmu3OJbVjWR0J1p1bxOlrB2LqnMv2tigQCu4,26
6
+ apiverve_phonenumbervalidator/tests/test_api.py,sha256=Dy_hUKWv_PQI9mq2CDYsDoQH-SrLodhlTKeAGhiZtB0,644
7
+ apiverve_phonenumbervalidator-1.1.4.dist-info/LICENSE,sha256=YsfLd-GMs4-ZhMK0ecz-_Jr9DX9cPphkby5JVKaPgEY,1109
8
+ apiverve_phonenumbervalidator-1.1.4.dist-info/METADATA,sha256=0AXfgSIiNlQ77e1NuBL-v7dpuGsqsDb1MmTmONHgeow,6055
9
+ apiverve_phonenumbervalidator-1.1.4.dist-info/WHEEL,sha256=Mdi9PDNwEZptOjTlUcAth7XJDFtKrHYaQMPulZeBCiQ,91
10
+ apiverve_phonenumbervalidator-1.1.4.dist-info/top_level.txt,sha256=YEFq3ZX6g9Wdvi2Qne8h_tNYUPCmwLY5tPDc6XFXbU0,30
11
+ apiverve_phonenumbervalidator-1.1.4.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (73.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ apiverve_phonenumbervalidator