apiverve-disposablephonenumberchecker 1.2.3__tar.gz

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.
Files changed (18) hide show
  1. apiverve_disposablephonenumberchecker-1.2.3/LICENSE +21 -0
  2. apiverve_disposablephonenumberchecker-1.2.3/PKG-INFO +305 -0
  3. apiverve_disposablephonenumberchecker-1.2.3/README.md +281 -0
  4. apiverve_disposablephonenumberchecker-1.2.3/pyproject.toml +29 -0
  5. apiverve_disposablephonenumberchecker-1.2.3/setup.cfg +4 -0
  6. apiverve_disposablephonenumberchecker-1.2.3/src/apiverve_disposablephonenumberchecker/__init__.py +3 -0
  7. apiverve_disposablephonenumberchecker-1.2.3/src/apiverve_disposablephonenumberchecker/apiClient.py +251 -0
  8. apiverve_disposablephonenumberchecker-1.2.3/src/apiverve_disposablephonenumberchecker/exceptions.py +3 -0
  9. apiverve_disposablephonenumberchecker-1.2.3/src/apiverve_disposablephonenumberchecker/setup.py +26 -0
  10. apiverve_disposablephonenumberchecker-1.2.3/src/apiverve_disposablephonenumberchecker/setup_dep.py +21 -0
  11. apiverve_disposablephonenumberchecker-1.2.3/src/apiverve_disposablephonenumberchecker/tests/__init__.py +1 -0
  12. apiverve_disposablephonenumberchecker-1.2.3/src/apiverve_disposablephonenumberchecker/tests/test_api.py +19 -0
  13. apiverve_disposablephonenumberchecker-1.2.3/src/apiverve_disposablephonenumberchecker.egg-info/PKG-INFO +305 -0
  14. apiverve_disposablephonenumberchecker-1.2.3/src/apiverve_disposablephonenumberchecker.egg-info/SOURCES.txt +16 -0
  15. apiverve_disposablephonenumberchecker-1.2.3/src/apiverve_disposablephonenumberchecker.egg-info/dependency_links.txt +1 -0
  16. apiverve_disposablephonenumberchecker-1.2.3/src/apiverve_disposablephonenumberchecker.egg-info/requires.txt +1 -0
  17. apiverve_disposablephonenumberchecker-1.2.3/src/apiverve_disposablephonenumberchecker.egg-info/top_level.txt +1 -0
  18. apiverve_disposablephonenumberchecker-1.2.3/tests/test_api.py +27 -0
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026 APIVerve and EvlarSoft 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,305 @@
1
+ Metadata-Version: 2.4
2
+ Name: apiverve-disposablephonenumberchecker
3
+ Version: 1.2.3
4
+ Summary: Disposable Phone Number Checker is a phone fraud API that flags temporary, burner and virtual phone numbers published on SMS-receiving sites. Pass a number in E.164 format to check whether it is disposable and see the date it was first seen on those lists.
5
+ Author-email: APIVerve <hello@apiverve.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://apiverve.com/marketplace/disposablephone?utm_source=pypi&utm_medium=referral&utm_content=homepage
8
+ Project-URL: Documentation, https://docs.apiverve.com/ref/disposablephone?utm_source=pypi&utm_medium=referral&utm_content=docs
9
+ Project-URL: Repository, https://github.com/apiverve/disposablephone-api
10
+ Project-URL: Twitter, https://twitter.com/apivervehq
11
+ Keywords: disposable phone number api,phone fraud api,burner phone check,temporary phone number detection,phone number spam detection
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Topic :: Internet :: WWW/HTTP
17
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
+ Classifier: Natural Language :: English
19
+ Requires-Python: >=3.9
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: requests>=2.25.0
23
+ Dynamic: license-file
24
+
25
+ Disposable Phone Number Checker API
26
+ ============
27
+
28
+ Disposable Phone Number Checker is a phone fraud API that flags temporary, burner and virtual phone numbers published on SMS-receiving sites. Pass a number in E.164 format to check whether it is disposable and see the date it was first seen on those lists.
29
+
30
+
31
+ [![PyPI version](https://img.shields.io/pypi/v/apiverve-disposablephonenumberchecker.svg)](https://pypi.org/project/apiverve-disposablephonenumberchecker/)
32
+
33
+ This is a Python wrapper for the [Disposable Phone Number Checker API](https://apiverve.com/marketplace/disposablephone?utm_source=pypi&utm_medium=referral&utm_content=readme)
34
+
35
+ ---
36
+
37
+ ## Installation
38
+
39
+ Using `pip`:
40
+
41
+ ```bash
42
+ pip install apiverve-disposablephonenumberchecker
43
+ ```
44
+
45
+ Using `pip3`:
46
+
47
+ ```bash
48
+ pip3 install apiverve-disposablephonenumberchecker
49
+ ```
50
+
51
+ ---
52
+
53
+ ## Configuration
54
+
55
+ Before using the Disposable Phone Number Checker API client, you have to setup your account and obtain your API Key.
56
+ You can get it by signing up at [https://apiverve.com](https://apiverve.com?utm_source=pypi&utm_medium=referral&utm_content=readme)
57
+
58
+ ---
59
+
60
+ ## Quick Start
61
+
62
+ Here's a simple example to get you started quickly:
63
+
64
+ ```python
65
+ from apiverve_disposablephonenumberchecker.apiClient import DisposablephoneAPIClient
66
+
67
+ # Initialize the client with your APIVerve API key
68
+ api = DisposablephoneAPIClient("[YOUR_API_KEY]")
69
+
70
+ query = {
71
+ "phone": "+12085813945",
72
+ "country": "US"
73
+ }
74
+
75
+ try:
76
+ # Make the API call
77
+ result = api.execute(query)
78
+
79
+ # Print the result
80
+ print(result)
81
+ except Exception as e:
82
+ print(f"Error: {e}")
83
+ ```
84
+
85
+ ---
86
+
87
+ ## Usage
88
+
89
+ The Disposable Phone Number Checker API documentation is found here: [https://docs.apiverve.com/ref/disposablephone](https://docs.apiverve.com/ref/disposablephone?utm_source=pypi&utm_medium=referral&utm_content=readme).
90
+ You can find parameters, example responses, and status codes documented here.
91
+
92
+ ### Setup
93
+
94
+ ```python
95
+ # Import the client module
96
+ from apiverve_disposablephonenumberchecker.apiClient import DisposablephoneAPIClient
97
+
98
+ # Initialize the client with your APIVerve API key
99
+ api = DisposablephoneAPIClient("[YOUR_API_KEY]")
100
+ ```
101
+
102
+ ---
103
+
104
+ ## Perform Request
105
+
106
+ Using the API client, you can perform requests to the API.
107
+
108
+ ###### Define Query
109
+
110
+ ```python
111
+ query = {
112
+ "phone": "+12085813945",
113
+ "country": "US"
114
+ }
115
+ ```
116
+
117
+ ###### Simple Request
118
+
119
+ ```python
120
+ # Make a request to the API
121
+ result = api.execute(query)
122
+
123
+ # Print the result
124
+ print(result)
125
+ ```
126
+
127
+ ###### Example Response
128
+
129
+ ```json
130
+ {
131
+ "status": "ok",
132
+ "error": null,
133
+ "data": {
134
+ "phone": "+12085813945",
135
+ "isDisposable": true,
136
+ "firstSeen": "2024-01-30",
137
+ "listedInRange": 12,
138
+ "isRiskyRange": true
139
+ }
140
+ }
141
+ ```
142
+
143
+ ---
144
+
145
+ ## Error Handling
146
+
147
+ The API client provides comprehensive error handling through the `DisposablephoneAPIClientError` exception. Here are some examples:
148
+
149
+ ### Basic Error Handling
150
+
151
+ ```python
152
+ from apiverve_disposablephonenumberchecker.apiClient import DisposablephoneAPIClient, DisposablephoneAPIClientError
153
+
154
+ api = DisposablephoneAPIClient("[YOUR_API_KEY]")
155
+
156
+ query = {
157
+ "phone": "+12085813945",
158
+ "country": "US"
159
+ }
160
+
161
+ try:
162
+ result = api.execute(query)
163
+ print("Success!")
164
+ print(result)
165
+ except DisposablephoneAPIClientError as e:
166
+ print(f"API Error: {e.message}")
167
+ if e.status_code:
168
+ print(f"Status Code: {e.status_code}")
169
+ if e.response:
170
+ print(f"Response: {e.response}")
171
+ ```
172
+
173
+ ### Handling Specific Error Types
174
+
175
+ ```python
176
+ from apiverve_disposablephonenumberchecker.apiClient import DisposablephoneAPIClient, DisposablephoneAPIClientError
177
+
178
+ api = DisposablephoneAPIClient("[YOUR_API_KEY]")
179
+
180
+ query = {
181
+ "phone": "+12085813945",
182
+ "country": "US"
183
+ }
184
+
185
+ try:
186
+ result = api.execute(query)
187
+
188
+ # Check for successful response
189
+ if result.get('status') == 'success':
190
+ print("Request successful!")
191
+ print(result.get('data'))
192
+ else:
193
+ print(f"API returned an error: {result.get('error')}")
194
+
195
+ except DisposablephoneAPIClientError as e:
196
+ # Handle API client errors
197
+ if e.status_code == 401:
198
+ print("Unauthorized: Invalid API key")
199
+ elif e.status_code == 429:
200
+ print("Rate limit exceeded")
201
+ elif e.status_code >= 500:
202
+ print("Server error - please try again later")
203
+ else:
204
+ print(f"API error: {e.message}")
205
+ except Exception as e:
206
+ # Handle unexpected errors
207
+ print(f"Unexpected error: {str(e)}")
208
+ ```
209
+
210
+ ### Using Context Manager (Recommended)
211
+
212
+ The client supports the context manager protocol for automatic resource cleanup:
213
+
214
+ ```python
215
+ from apiverve_disposablephonenumberchecker.apiClient import DisposablephoneAPIClient, DisposablephoneAPIClientError
216
+
217
+ query = {
218
+ "phone": "+12085813945",
219
+ "country": "US"
220
+ }
221
+
222
+ # Using context manager ensures proper cleanup
223
+ with DisposablephoneAPIClient("[YOUR_API_KEY]") as api:
224
+ try:
225
+ result = api.execute(query)
226
+ print(result)
227
+ except DisposablephoneAPIClientError as e:
228
+ print(f"Error: {e.message}")
229
+ # Session is automatically closed here
230
+ ```
231
+
232
+ ---
233
+
234
+ ## Advanced Features
235
+
236
+ ### Debug Mode
237
+
238
+ Enable debug logging to see detailed request and response information:
239
+
240
+ ```python
241
+ from apiverve_disposablephonenumberchecker.apiClient import DisposablephoneAPIClient
242
+
243
+ # Enable debug mode
244
+ api = DisposablephoneAPIClient("[YOUR_API_KEY]", debug=True)
245
+
246
+ query = {
247
+ "phone": "+12085813945",
248
+ "country": "US"
249
+ }
250
+
251
+ # Debug information will be printed to console
252
+ result = api.execute(query)
253
+ ```
254
+
255
+ ### Manual Session Management
256
+
257
+ If you need to manually manage the session lifecycle:
258
+
259
+ ```python
260
+ from apiverve_disposablephonenumberchecker.apiClient import DisposablephoneAPIClient
261
+
262
+ api = DisposablephoneAPIClient("[YOUR_API_KEY]")
263
+
264
+ query = {
265
+ "phone": "+12085813945",
266
+ "country": "US"
267
+ }
268
+
269
+ try:
270
+ result = api.execute(query)
271
+ print(result)
272
+ finally:
273
+ # Manually close the session when done
274
+ api.close()
275
+ ```
276
+
277
+ ---
278
+
279
+ ## Customer Support
280
+
281
+ Need any assistance? [Get in touch with Customer Support](https://apiverve.com/contact?utm_source=pypi&utm_medium=referral&utm_content=readme).
282
+
283
+ ---
284
+
285
+ ## Updates
286
+ Stay up to date by following [@apiverveHQ](https://twitter.com/apiverveHQ) on Twitter.
287
+
288
+ ---
289
+
290
+ ## Legal
291
+
292
+ All usage of the APIVerve website, API, and services is subject to the [APIVerve Terms of Service](https://apiverve.com/terms?utm_source=pypi&utm_medium=referral&utm_content=readme) and all legal documents and agreements.
293
+
294
+ ---
295
+
296
+ ## License
297
+ Licensed under the MIT License (MIT)
298
+
299
+ Copyright (&copy;) 2026 APIVerve, and EvlarSoft LLC
300
+
301
+ 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:
302
+
303
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
304
+
305
+ 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,281 @@
1
+ Disposable Phone Number Checker API
2
+ ============
3
+
4
+ Disposable Phone Number Checker is a phone fraud API that flags temporary, burner and virtual phone numbers published on SMS-receiving sites. Pass a number in E.164 format to check whether it is disposable and see the date it was first seen on those lists.
5
+
6
+
7
+ [![PyPI version](https://img.shields.io/pypi/v/apiverve-disposablephonenumberchecker.svg)](https://pypi.org/project/apiverve-disposablephonenumberchecker/)
8
+
9
+ This is a Python wrapper for the [Disposable Phone Number Checker API](https://apiverve.com/marketplace/disposablephone?utm_source=pypi&utm_medium=referral&utm_content=readme)
10
+
11
+ ---
12
+
13
+ ## Installation
14
+
15
+ Using `pip`:
16
+
17
+ ```bash
18
+ pip install apiverve-disposablephonenumberchecker
19
+ ```
20
+
21
+ Using `pip3`:
22
+
23
+ ```bash
24
+ pip3 install apiverve-disposablephonenumberchecker
25
+ ```
26
+
27
+ ---
28
+
29
+ ## Configuration
30
+
31
+ Before using the Disposable Phone Number Checker API client, you have to setup your account and obtain your API Key.
32
+ You can get it by signing up at [https://apiverve.com](https://apiverve.com?utm_source=pypi&utm_medium=referral&utm_content=readme)
33
+
34
+ ---
35
+
36
+ ## Quick Start
37
+
38
+ Here's a simple example to get you started quickly:
39
+
40
+ ```python
41
+ from apiverve_disposablephonenumberchecker.apiClient import DisposablephoneAPIClient
42
+
43
+ # Initialize the client with your APIVerve API key
44
+ api = DisposablephoneAPIClient("[YOUR_API_KEY]")
45
+
46
+ query = {
47
+ "phone": "+12085813945",
48
+ "country": "US"
49
+ }
50
+
51
+ try:
52
+ # Make the API call
53
+ result = api.execute(query)
54
+
55
+ # Print the result
56
+ print(result)
57
+ except Exception as e:
58
+ print(f"Error: {e}")
59
+ ```
60
+
61
+ ---
62
+
63
+ ## Usage
64
+
65
+ The Disposable Phone Number Checker API documentation is found here: [https://docs.apiverve.com/ref/disposablephone](https://docs.apiverve.com/ref/disposablephone?utm_source=pypi&utm_medium=referral&utm_content=readme).
66
+ You can find parameters, example responses, and status codes documented here.
67
+
68
+ ### Setup
69
+
70
+ ```python
71
+ # Import the client module
72
+ from apiverve_disposablephonenumberchecker.apiClient import DisposablephoneAPIClient
73
+
74
+ # Initialize the client with your APIVerve API key
75
+ api = DisposablephoneAPIClient("[YOUR_API_KEY]")
76
+ ```
77
+
78
+ ---
79
+
80
+ ## Perform Request
81
+
82
+ Using the API client, you can perform requests to the API.
83
+
84
+ ###### Define Query
85
+
86
+ ```python
87
+ query = {
88
+ "phone": "+12085813945",
89
+ "country": "US"
90
+ }
91
+ ```
92
+
93
+ ###### Simple Request
94
+
95
+ ```python
96
+ # Make a request to the API
97
+ result = api.execute(query)
98
+
99
+ # Print the result
100
+ print(result)
101
+ ```
102
+
103
+ ###### Example Response
104
+
105
+ ```json
106
+ {
107
+ "status": "ok",
108
+ "error": null,
109
+ "data": {
110
+ "phone": "+12085813945",
111
+ "isDisposable": true,
112
+ "firstSeen": "2024-01-30",
113
+ "listedInRange": 12,
114
+ "isRiskyRange": true
115
+ }
116
+ }
117
+ ```
118
+
119
+ ---
120
+
121
+ ## Error Handling
122
+
123
+ The API client provides comprehensive error handling through the `DisposablephoneAPIClientError` exception. Here are some examples:
124
+
125
+ ### Basic Error Handling
126
+
127
+ ```python
128
+ from apiverve_disposablephonenumberchecker.apiClient import DisposablephoneAPIClient, DisposablephoneAPIClientError
129
+
130
+ api = DisposablephoneAPIClient("[YOUR_API_KEY]")
131
+
132
+ query = {
133
+ "phone": "+12085813945",
134
+ "country": "US"
135
+ }
136
+
137
+ try:
138
+ result = api.execute(query)
139
+ print("Success!")
140
+ print(result)
141
+ except DisposablephoneAPIClientError as e:
142
+ print(f"API Error: {e.message}")
143
+ if e.status_code:
144
+ print(f"Status Code: {e.status_code}")
145
+ if e.response:
146
+ print(f"Response: {e.response}")
147
+ ```
148
+
149
+ ### Handling Specific Error Types
150
+
151
+ ```python
152
+ from apiverve_disposablephonenumberchecker.apiClient import DisposablephoneAPIClient, DisposablephoneAPIClientError
153
+
154
+ api = DisposablephoneAPIClient("[YOUR_API_KEY]")
155
+
156
+ query = {
157
+ "phone": "+12085813945",
158
+ "country": "US"
159
+ }
160
+
161
+ try:
162
+ result = api.execute(query)
163
+
164
+ # Check for successful response
165
+ if result.get('status') == 'success':
166
+ print("Request successful!")
167
+ print(result.get('data'))
168
+ else:
169
+ print(f"API returned an error: {result.get('error')}")
170
+
171
+ except DisposablephoneAPIClientError as e:
172
+ # Handle API client errors
173
+ if e.status_code == 401:
174
+ print("Unauthorized: Invalid API key")
175
+ elif e.status_code == 429:
176
+ print("Rate limit exceeded")
177
+ elif e.status_code >= 500:
178
+ print("Server error - please try again later")
179
+ else:
180
+ print(f"API error: {e.message}")
181
+ except Exception as e:
182
+ # Handle unexpected errors
183
+ print(f"Unexpected error: {str(e)}")
184
+ ```
185
+
186
+ ### Using Context Manager (Recommended)
187
+
188
+ The client supports the context manager protocol for automatic resource cleanup:
189
+
190
+ ```python
191
+ from apiverve_disposablephonenumberchecker.apiClient import DisposablephoneAPIClient, DisposablephoneAPIClientError
192
+
193
+ query = {
194
+ "phone": "+12085813945",
195
+ "country": "US"
196
+ }
197
+
198
+ # Using context manager ensures proper cleanup
199
+ with DisposablephoneAPIClient("[YOUR_API_KEY]") as api:
200
+ try:
201
+ result = api.execute(query)
202
+ print(result)
203
+ except DisposablephoneAPIClientError as e:
204
+ print(f"Error: {e.message}")
205
+ # Session is automatically closed here
206
+ ```
207
+
208
+ ---
209
+
210
+ ## Advanced Features
211
+
212
+ ### Debug Mode
213
+
214
+ Enable debug logging to see detailed request and response information:
215
+
216
+ ```python
217
+ from apiverve_disposablephonenumberchecker.apiClient import DisposablephoneAPIClient
218
+
219
+ # Enable debug mode
220
+ api = DisposablephoneAPIClient("[YOUR_API_KEY]", debug=True)
221
+
222
+ query = {
223
+ "phone": "+12085813945",
224
+ "country": "US"
225
+ }
226
+
227
+ # Debug information will be printed to console
228
+ result = api.execute(query)
229
+ ```
230
+
231
+ ### Manual Session Management
232
+
233
+ If you need to manually manage the session lifecycle:
234
+
235
+ ```python
236
+ from apiverve_disposablephonenumberchecker.apiClient import DisposablephoneAPIClient
237
+
238
+ api = DisposablephoneAPIClient("[YOUR_API_KEY]")
239
+
240
+ query = {
241
+ "phone": "+12085813945",
242
+ "country": "US"
243
+ }
244
+
245
+ try:
246
+ result = api.execute(query)
247
+ print(result)
248
+ finally:
249
+ # Manually close the session when done
250
+ api.close()
251
+ ```
252
+
253
+ ---
254
+
255
+ ## Customer Support
256
+
257
+ Need any assistance? [Get in touch with Customer Support](https://apiverve.com/contact?utm_source=pypi&utm_medium=referral&utm_content=readme).
258
+
259
+ ---
260
+
261
+ ## Updates
262
+ Stay up to date by following [@apiverveHQ](https://twitter.com/apiverveHQ) on Twitter.
263
+
264
+ ---
265
+
266
+ ## Legal
267
+
268
+ All usage of the APIVerve website, API, and services is subject to the [APIVerve Terms of Service](https://apiverve.com/terms?utm_source=pypi&utm_medium=referral&utm_content=readme) and all legal documents and agreements.
269
+
270
+ ---
271
+
272
+ ## License
273
+ Licensed under the MIT License (MIT)
274
+
275
+ Copyright (&copy;) 2026 APIVerve, and EvlarSoft LLC
276
+
277
+ 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:
278
+
279
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
280
+
281
+ 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,29 @@
1
+ [project]
2
+ name = "apiverve-disposablephonenumberchecker"
3
+ version = "1.2.3"
4
+ authors = [
5
+ { name="APIVerve", email="hello@apiverve.com" },
6
+ ]
7
+ description = "Disposable Phone Number Checker is a phone fraud API that flags temporary, burner and virtual phone numbers published on SMS-receiving sites. Pass a number in E.164 format to check whether it is disposable and see the date it was first seen on those lists."
8
+ keywords = ["disposable phone number api", "phone fraud api", "burner phone check", "temporary phone number detection", "phone number spam detection"]
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = {text = "MIT"}
12
+ dependencies = [
13
+ "requests>=2.25.0"
14
+ ]
15
+ classifiers = [
16
+ "Development Status :: 5 - Production/Stable",
17
+ "Programming Language :: Python :: 3",
18
+ "Operating System :: OS Independent",
19
+ "Intended Audience :: Developers",
20
+ "Topic :: Internet :: WWW/HTTP",
21
+ "Topic :: Software Development :: Libraries :: Python Modules",
22
+ "Natural Language :: English",
23
+ ]
24
+
25
+ [project.urls]
26
+ Homepage = "https://apiverve.com/marketplace/disposablephone?utm_source=pypi&utm_medium=referral&utm_content=homepage"
27
+ Documentation = "https://docs.apiverve.com/ref/disposablephone?utm_source=pypi&utm_medium=referral&utm_content=docs"
28
+ Repository = "https://github.com/apiverve/disposablephone-api"
29
+ Twitter = "https://twitter.com/apivervehq"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ from .apiClient import DisposablephoneAPIClient, DisposablephoneAPIClientError
2
+
3
+ __all__ = ['DisposablephoneAPIClient', 'DisposablephoneAPIClientError']
@@ -0,0 +1,251 @@
1
+ import re
2
+ from typing import Dict, Optional, Any, List
3
+ from dataclasses import dataclass
4
+ import requests
5
+
6
+
7
+ class DisposablephoneAPIClientError(Exception):
8
+ """Custom exception for API client errors"""
9
+ def __init__(self, message: str, status_code: Optional[int] = None, response: Optional[Dict] = None):
10
+ self.message = message
11
+ self.status_code = status_code
12
+ self.response = response
13
+ super().__init__(self.message)
14
+
15
+
16
+ class ValidationError(DisposablephoneAPIClientError):
17
+ """Custom exception for parameter validation errors"""
18
+ def __init__(self, errors: List[str]):
19
+ self.errors = errors
20
+ message = f"Validation failed: {' '.join(errors)}"
21
+ super().__init__(message)
22
+
23
+
24
+ class DisposablephoneAPIClient:
25
+ # Validation rules for parameters (generated from schema)
26
+ VALIDATION_RULES = {
27
+ "phone": {"type": "string", "required": True, "format": "phone"},
28
+ "country": {"type": "string", "required": False}
29
+ }
30
+
31
+ # Format validation patterns
32
+ FORMAT_PATTERNS = {
33
+ 'email': r'^[^\s@]+@[^\s@]+\.[^\s@]+$',
34
+ 'url': r'^https?://.+',
35
+ 'ip': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$|^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$',
36
+ 'date': r'^\d{4}-\d{2}-\d{2}$',
37
+ 'hexColor': r'^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$'
38
+ }
39
+
40
+ def __init__(self, api_key: str, secure: bool = True, debug: bool = False):
41
+ """
42
+ Initialize the DisposablephoneAPIClient with the API key and optional settings
43
+
44
+ :param api_key: Your APIVerve API key
45
+ :param secure: Deprecated. Always set to True
46
+ :param debug: Enable debug logging (default: False)
47
+ :raises DisposablephoneAPIClientError: If API key is invalid
48
+ """
49
+
50
+ self._validate_api_key(api_key)
51
+
52
+ self.api_key = api_key
53
+ self.secure = secure
54
+ self.debug = debug
55
+ self.base_url = 'https://api.apiverve.com/v1/disposablephone'
56
+ self.headers = {
57
+ 'x-api-key': self.api_key,
58
+ 'auth-mode': 'pypi-package'
59
+ }
60
+
61
+ # Create a session for connection pooling
62
+ self.session = requests.Session()
63
+ self.session.headers.update(self.headers)
64
+
65
+ def _validate_api_key(self, api_key: str) -> None:
66
+ """
67
+ Validate the API key format
68
+
69
+ :param api_key: API key to validate
70
+ :raises DisposablephoneAPIClientError: If API key is invalid
71
+ """
72
+ if not api_key or not api_key.strip():
73
+ raise DisposablephoneAPIClientError(
74
+ "API key is required. Get your API key at: https://apiverve.com"
75
+ )
76
+
77
+ # Check format (GUID, prefixed keys like apv_xxx, or alphanumeric)
78
+ if not re.match(r'^[a-zA-Z0-9_-]+$', api_key):
79
+ raise DisposablephoneAPIClientError(
80
+ "Invalid API key format. API key should only contain letters, numbers, hyphens, and underscores. "
81
+ "Get your API key at: https://apiverve.com"
82
+ )
83
+
84
+ def _log(self, message: str) -> None:
85
+ """
86
+ Log a debug message if debug mode is enabled
87
+
88
+ :param message: Message to log
89
+ """
90
+ if self.debug:
91
+ print(f"[DisposablephoneAPIClient DEBUG] {message}")
92
+
93
+ def _validate_params(self, params: Optional[Dict[str, Any]]) -> None:
94
+ """
95
+ Validate parameters against schema rules
96
+
97
+ :param params: Parameters to validate
98
+ :raises ValidationError: If validation fails
99
+ """
100
+ if not self.VALIDATION_RULES:
101
+ return
102
+
103
+ errors = []
104
+ params = params or {}
105
+
106
+ for param_name, rules in self.VALIDATION_RULES.items():
107
+ value = params.get(param_name)
108
+
109
+ # Check required
110
+ if rules.get('required') and (value is None or value == ''):
111
+ errors.append(f"Required parameter [{param_name}] is missing.")
112
+ continue
113
+
114
+ # Skip validation if value is not provided and not required
115
+ if value is None:
116
+ continue
117
+
118
+ param_type = rules.get('type', 'string')
119
+
120
+ # Type validation
121
+ if param_type in ('integer', 'number'):
122
+ try:
123
+ num_value = float(value) if param_type == 'number' else int(value)
124
+
125
+ # Min/max validation
126
+ if 'min' in rules and num_value < rules['min']:
127
+ errors.append(f"Parameter [{param_name}] must be at least {rules['min']}.")
128
+ if 'max' in rules and num_value > rules['max']:
129
+ errors.append(f"Parameter [{param_name}] must be at most {rules['max']}.")
130
+ except (ValueError, TypeError):
131
+ errors.append(f"Parameter [{param_name}] must be a valid {param_type}.")
132
+ continue
133
+
134
+ elif param_type == 'string':
135
+ if not isinstance(value, str):
136
+ errors.append(f"Parameter [{param_name}] must be a string.")
137
+ continue
138
+
139
+ # Length validation
140
+ if 'minLength' in rules and len(value) < rules['minLength']:
141
+ errors.append(f"Parameter [{param_name}] must be at least {rules['minLength']} characters.")
142
+ if 'maxLength' in rules and len(value) > rules['maxLength']:
143
+ errors.append(f"Parameter [{param_name}] must be at most {rules['maxLength']} characters.")
144
+
145
+ # Format validation
146
+ if 'format' in rules and rules['format'] in self.FORMAT_PATTERNS:
147
+ pattern = self.FORMAT_PATTERNS[rules['format']]
148
+ if not re.match(pattern, value, re.IGNORECASE):
149
+ errors.append(f"Parameter [{param_name}] must be a valid {rules['format']}.")
150
+
151
+ elif param_type == 'boolean':
152
+ if not isinstance(value, bool) and value not in ('true', 'false', True, False):
153
+ errors.append(f"Parameter [{param_name}] must be a boolean.")
154
+
155
+ elif param_type == 'array':
156
+ if not isinstance(value, list):
157
+ errors.append(f"Parameter [{param_name}] must be an array.")
158
+
159
+ # Enum validation
160
+ if 'enum' in rules and value not in rules['enum']:
161
+ errors.append(f"Parameter [{param_name}] must be one of: {', '.join(map(str, rules['enum']))}.")
162
+
163
+ if errors:
164
+ raise ValidationError(errors)
165
+
166
+ def execute(self, params: Optional[Dict[str, Any]] = None) -> Dict[str, Any]: # Returns DisposablePhoneNumberCheckerData in 'data' field
167
+ """
168
+ Execute the API request
169
+
170
+ :param params: API parameters (optional)
171
+ :return: API response as a dictionary
172
+ :raises DisposablephoneAPIClientError: If the request fails or returns an error
173
+ :raises ValidationError: If parameter validation fails
174
+ """
175
+
176
+ # Validate parameters against schema rules
177
+ self._validate_params(params)
178
+
179
+ method = "GET"
180
+
181
+ self._log(f"Making {method} request to {self.base_url}")
182
+ if params:
183
+ self._log(f"Parameters: {params}")
184
+
185
+ try:
186
+ if method.upper() == 'POST':
187
+ self._log("Sending POST request with JSON body")
188
+ response = self.session.post(self.base_url, json=params, timeout=30)
189
+ else:
190
+ self._log("Sending GET request with query parameters")
191
+ response = self.session.get(self.base_url, params=params, timeout=30)
192
+
193
+ self._log(f"Response status code: {response.status_code}")
194
+
195
+ # Try to parse JSON response
196
+ try:
197
+ response_data = response.json()
198
+ except ValueError as e:
199
+ raise DisposablephoneAPIClientError(
200
+ f"Invalid JSON response from API: {str(e)}",
201
+ status_code=response.status_code
202
+ )
203
+
204
+ # Check for API-level errors in the response
205
+ if response_data.get('status') == 'error':
206
+ error_message = response_data.get('error', 'Unknown API error')
207
+ self._log(f"API returned error: {error_message}")
208
+ raise DisposablephoneAPIClientError(
209
+ error_message,
210
+ status_code=response.status_code,
211
+ response=response_data
212
+ )
213
+
214
+ # Check HTTP status code
215
+ if not response.ok:
216
+ error_message = response_data.get('error', f"HTTP {response.status_code} error")
217
+ self._log(f"HTTP error: {error_message}")
218
+ raise DisposablephoneAPIClientError(
219
+ error_message,
220
+ status_code=response.status_code,
221
+ response=response_data
222
+ )
223
+
224
+ self._log("Request successful")
225
+ return response_data
226
+
227
+ except requests.exceptions.Timeout as e:
228
+ self._log(f"Request timeout: {str(e)}")
229
+ raise DisposablephoneAPIClientError(f"Request timeout: {str(e)}")
230
+ except requests.exceptions.ConnectionError as e:
231
+ self._log(f"Connection error: {str(e)}")
232
+ raise DisposablephoneAPIClientError(f"Connection error: {str(e)}")
233
+ except requests.exceptions.RequestException as e:
234
+ self._log(f"Request exception: {str(e)}")
235
+ raise DisposablephoneAPIClientError(f"Request failed: {str(e)}")
236
+
237
+
238
+ def close(self) -> None:
239
+ """
240
+ Close the session and release resources
241
+ """
242
+ self._log("Closing session")
243
+ self.session.close()
244
+
245
+ def __enter__(self):
246
+ """Context manager entry"""
247
+ return self
248
+
249
+ def __exit__(self, exc_type, exc_val, exc_tb):
250
+ """Context manager exit"""
251
+ self.close()
@@ -0,0 +1,3 @@
1
+ class DisposablephoneDisposablePhoneNumberCheckerAPIError(Exception):
2
+ """A custom exception for API errors"""
3
+ pass
@@ -0,0 +1,26 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ import os
4
+ lib_folder = os.path.dirname(os.path.realpath(__file__))
5
+ requirements_file = os.path.join(lib_folder, 'requirements.txt')
6
+ install_requires = ["requests >= 2.25.1", "setuptools >= 56.0.0"]
7
+ if os.path.exists(requirements_file):
8
+ with open(requirements_file, 'r') as f:
9
+ install_requires = f.read().splitlines()
10
+
11
+ setup(
12
+ name='apiverve_disposablephonenumberchecker',
13
+ version='1.2.3',
14
+ packages=find_packages(),
15
+ include_package_data=True,
16
+ install_requires=install_requires,
17
+ description='Disposable Phone Number Checker is a phone fraud API that flags temporary, burner and virtual phone numbers published on SMS-receiving sites. Pass a number in E.164 format to check whether it is disposable and see the date it was first seen on those lists.',
18
+ author='APIVerve',
19
+ author_email='hello@apiverve.com',
20
+ url='https://apiverve.com/marketplace/disposablephone?utm_source=pypi&utm_medium=referral&utm_content=homepage',
21
+ classifiers=[
22
+ 'Programming Language :: Python :: 3',
23
+ 'Operating System :: OS Independent',
24
+ ],
25
+ python_requires='>=3.6',
26
+ )
@@ -0,0 +1,21 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name='apiverve_disposablephonenumberchecker',
5
+ version='1.2.3',
6
+ packages=find_packages(),
7
+ include_package_data=True,
8
+ install_requires=[
9
+ 'requests',
10
+ 'setuptools'
11
+ ],
12
+ description='Disposable Phone Number Checker is a phone fraud API that flags temporary, burner and virtual phone numbers published on SMS-receiving sites. Pass a number in E.164 format to check whether it is disposable and see the date it was first seen on those lists.',
13
+ author='APIVerve',
14
+ author_email='hello@apiverve.com',
15
+ url='https://apiverve.com/marketplace/disposablephone?utm_source=pypi&utm_medium=referral&utm_content=homepage',
16
+ classifiers=[
17
+ 'Programming Language :: Python :: 3',
18
+ 'Operating System :: OS Independent',
19
+ ],
20
+ python_requires='>=3.6',
21
+ )
@@ -0,0 +1,19 @@
1
+ import unittest
2
+ from apiverve_disposablephonenumberchecker.apiClient import DisposablephoneAPIClient
3
+
4
+ class TestClient(unittest.TestCase):
5
+
6
+ def setUp(self):
7
+ self.api_key = 'test_api_key'
8
+ self.client = DisposablephoneAPIClient(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,305 @@
1
+ Metadata-Version: 2.4
2
+ Name: apiverve-disposablephonenumberchecker
3
+ Version: 1.2.3
4
+ Summary: Disposable Phone Number Checker is a phone fraud API that flags temporary, burner and virtual phone numbers published on SMS-receiving sites. Pass a number in E.164 format to check whether it is disposable and see the date it was first seen on those lists.
5
+ Author-email: APIVerve <hello@apiverve.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://apiverve.com/marketplace/disposablephone?utm_source=pypi&utm_medium=referral&utm_content=homepage
8
+ Project-URL: Documentation, https://docs.apiverve.com/ref/disposablephone?utm_source=pypi&utm_medium=referral&utm_content=docs
9
+ Project-URL: Repository, https://github.com/apiverve/disposablephone-api
10
+ Project-URL: Twitter, https://twitter.com/apivervehq
11
+ Keywords: disposable phone number api,phone fraud api,burner phone check,temporary phone number detection,phone number spam detection
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Topic :: Internet :: WWW/HTTP
17
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
+ Classifier: Natural Language :: English
19
+ Requires-Python: >=3.9
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: requests>=2.25.0
23
+ Dynamic: license-file
24
+
25
+ Disposable Phone Number Checker API
26
+ ============
27
+
28
+ Disposable Phone Number Checker is a phone fraud API that flags temporary, burner and virtual phone numbers published on SMS-receiving sites. Pass a number in E.164 format to check whether it is disposable and see the date it was first seen on those lists.
29
+
30
+
31
+ [![PyPI version](https://img.shields.io/pypi/v/apiverve-disposablephonenumberchecker.svg)](https://pypi.org/project/apiverve-disposablephonenumberchecker/)
32
+
33
+ This is a Python wrapper for the [Disposable Phone Number Checker API](https://apiverve.com/marketplace/disposablephone?utm_source=pypi&utm_medium=referral&utm_content=readme)
34
+
35
+ ---
36
+
37
+ ## Installation
38
+
39
+ Using `pip`:
40
+
41
+ ```bash
42
+ pip install apiverve-disposablephonenumberchecker
43
+ ```
44
+
45
+ Using `pip3`:
46
+
47
+ ```bash
48
+ pip3 install apiverve-disposablephonenumberchecker
49
+ ```
50
+
51
+ ---
52
+
53
+ ## Configuration
54
+
55
+ Before using the Disposable Phone Number Checker API client, you have to setup your account and obtain your API Key.
56
+ You can get it by signing up at [https://apiverve.com](https://apiverve.com?utm_source=pypi&utm_medium=referral&utm_content=readme)
57
+
58
+ ---
59
+
60
+ ## Quick Start
61
+
62
+ Here's a simple example to get you started quickly:
63
+
64
+ ```python
65
+ from apiverve_disposablephonenumberchecker.apiClient import DisposablephoneAPIClient
66
+
67
+ # Initialize the client with your APIVerve API key
68
+ api = DisposablephoneAPIClient("[YOUR_API_KEY]")
69
+
70
+ query = {
71
+ "phone": "+12085813945",
72
+ "country": "US"
73
+ }
74
+
75
+ try:
76
+ # Make the API call
77
+ result = api.execute(query)
78
+
79
+ # Print the result
80
+ print(result)
81
+ except Exception as e:
82
+ print(f"Error: {e}")
83
+ ```
84
+
85
+ ---
86
+
87
+ ## Usage
88
+
89
+ The Disposable Phone Number Checker API documentation is found here: [https://docs.apiverve.com/ref/disposablephone](https://docs.apiverve.com/ref/disposablephone?utm_source=pypi&utm_medium=referral&utm_content=readme).
90
+ You can find parameters, example responses, and status codes documented here.
91
+
92
+ ### Setup
93
+
94
+ ```python
95
+ # Import the client module
96
+ from apiverve_disposablephonenumberchecker.apiClient import DisposablephoneAPIClient
97
+
98
+ # Initialize the client with your APIVerve API key
99
+ api = DisposablephoneAPIClient("[YOUR_API_KEY]")
100
+ ```
101
+
102
+ ---
103
+
104
+ ## Perform Request
105
+
106
+ Using the API client, you can perform requests to the API.
107
+
108
+ ###### Define Query
109
+
110
+ ```python
111
+ query = {
112
+ "phone": "+12085813945",
113
+ "country": "US"
114
+ }
115
+ ```
116
+
117
+ ###### Simple Request
118
+
119
+ ```python
120
+ # Make a request to the API
121
+ result = api.execute(query)
122
+
123
+ # Print the result
124
+ print(result)
125
+ ```
126
+
127
+ ###### Example Response
128
+
129
+ ```json
130
+ {
131
+ "status": "ok",
132
+ "error": null,
133
+ "data": {
134
+ "phone": "+12085813945",
135
+ "isDisposable": true,
136
+ "firstSeen": "2024-01-30",
137
+ "listedInRange": 12,
138
+ "isRiskyRange": true
139
+ }
140
+ }
141
+ ```
142
+
143
+ ---
144
+
145
+ ## Error Handling
146
+
147
+ The API client provides comprehensive error handling through the `DisposablephoneAPIClientError` exception. Here are some examples:
148
+
149
+ ### Basic Error Handling
150
+
151
+ ```python
152
+ from apiverve_disposablephonenumberchecker.apiClient import DisposablephoneAPIClient, DisposablephoneAPIClientError
153
+
154
+ api = DisposablephoneAPIClient("[YOUR_API_KEY]")
155
+
156
+ query = {
157
+ "phone": "+12085813945",
158
+ "country": "US"
159
+ }
160
+
161
+ try:
162
+ result = api.execute(query)
163
+ print("Success!")
164
+ print(result)
165
+ except DisposablephoneAPIClientError as e:
166
+ print(f"API Error: {e.message}")
167
+ if e.status_code:
168
+ print(f"Status Code: {e.status_code}")
169
+ if e.response:
170
+ print(f"Response: {e.response}")
171
+ ```
172
+
173
+ ### Handling Specific Error Types
174
+
175
+ ```python
176
+ from apiverve_disposablephonenumberchecker.apiClient import DisposablephoneAPIClient, DisposablephoneAPIClientError
177
+
178
+ api = DisposablephoneAPIClient("[YOUR_API_KEY]")
179
+
180
+ query = {
181
+ "phone": "+12085813945",
182
+ "country": "US"
183
+ }
184
+
185
+ try:
186
+ result = api.execute(query)
187
+
188
+ # Check for successful response
189
+ if result.get('status') == 'success':
190
+ print("Request successful!")
191
+ print(result.get('data'))
192
+ else:
193
+ print(f"API returned an error: {result.get('error')}")
194
+
195
+ except DisposablephoneAPIClientError as e:
196
+ # Handle API client errors
197
+ if e.status_code == 401:
198
+ print("Unauthorized: Invalid API key")
199
+ elif e.status_code == 429:
200
+ print("Rate limit exceeded")
201
+ elif e.status_code >= 500:
202
+ print("Server error - please try again later")
203
+ else:
204
+ print(f"API error: {e.message}")
205
+ except Exception as e:
206
+ # Handle unexpected errors
207
+ print(f"Unexpected error: {str(e)}")
208
+ ```
209
+
210
+ ### Using Context Manager (Recommended)
211
+
212
+ The client supports the context manager protocol for automatic resource cleanup:
213
+
214
+ ```python
215
+ from apiverve_disposablephonenumberchecker.apiClient import DisposablephoneAPIClient, DisposablephoneAPIClientError
216
+
217
+ query = {
218
+ "phone": "+12085813945",
219
+ "country": "US"
220
+ }
221
+
222
+ # Using context manager ensures proper cleanup
223
+ with DisposablephoneAPIClient("[YOUR_API_KEY]") as api:
224
+ try:
225
+ result = api.execute(query)
226
+ print(result)
227
+ except DisposablephoneAPIClientError as e:
228
+ print(f"Error: {e.message}")
229
+ # Session is automatically closed here
230
+ ```
231
+
232
+ ---
233
+
234
+ ## Advanced Features
235
+
236
+ ### Debug Mode
237
+
238
+ Enable debug logging to see detailed request and response information:
239
+
240
+ ```python
241
+ from apiverve_disposablephonenumberchecker.apiClient import DisposablephoneAPIClient
242
+
243
+ # Enable debug mode
244
+ api = DisposablephoneAPIClient("[YOUR_API_KEY]", debug=True)
245
+
246
+ query = {
247
+ "phone": "+12085813945",
248
+ "country": "US"
249
+ }
250
+
251
+ # Debug information will be printed to console
252
+ result = api.execute(query)
253
+ ```
254
+
255
+ ### Manual Session Management
256
+
257
+ If you need to manually manage the session lifecycle:
258
+
259
+ ```python
260
+ from apiverve_disposablephonenumberchecker.apiClient import DisposablephoneAPIClient
261
+
262
+ api = DisposablephoneAPIClient("[YOUR_API_KEY]")
263
+
264
+ query = {
265
+ "phone": "+12085813945",
266
+ "country": "US"
267
+ }
268
+
269
+ try:
270
+ result = api.execute(query)
271
+ print(result)
272
+ finally:
273
+ # Manually close the session when done
274
+ api.close()
275
+ ```
276
+
277
+ ---
278
+
279
+ ## Customer Support
280
+
281
+ Need any assistance? [Get in touch with Customer Support](https://apiverve.com/contact?utm_source=pypi&utm_medium=referral&utm_content=readme).
282
+
283
+ ---
284
+
285
+ ## Updates
286
+ Stay up to date by following [@apiverveHQ](https://twitter.com/apiverveHQ) on Twitter.
287
+
288
+ ---
289
+
290
+ ## Legal
291
+
292
+ All usage of the APIVerve website, API, and services is subject to the [APIVerve Terms of Service](https://apiverve.com/terms?utm_source=pypi&utm_medium=referral&utm_content=readme) and all legal documents and agreements.
293
+
294
+ ---
295
+
296
+ ## License
297
+ Licensed under the MIT License (MIT)
298
+
299
+ Copyright (&copy;) 2026 APIVerve, and EvlarSoft LLC
300
+
301
+ 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:
302
+
303
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
304
+
305
+ 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,16 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/apiverve_disposablephonenumberchecker/__init__.py
5
+ src/apiverve_disposablephonenumberchecker/apiClient.py
6
+ src/apiverve_disposablephonenumberchecker/exceptions.py
7
+ src/apiverve_disposablephonenumberchecker/setup.py
8
+ src/apiverve_disposablephonenumberchecker/setup_dep.py
9
+ src/apiverve_disposablephonenumberchecker.egg-info/PKG-INFO
10
+ src/apiverve_disposablephonenumberchecker.egg-info/SOURCES.txt
11
+ src/apiverve_disposablephonenumberchecker.egg-info/dependency_links.txt
12
+ src/apiverve_disposablephonenumberchecker.egg-info/requires.txt
13
+ src/apiverve_disposablephonenumberchecker.egg-info/top_level.txt
14
+ src/apiverve_disposablephonenumberchecker/tests/__init__.py
15
+ src/apiverve_disposablephonenumberchecker/tests/test_api.py
16
+ tests/test_api.py
@@ -0,0 +1,27 @@
1
+ import unittest
2
+ from apiverve_disposablephonenumberchecker.apiClient import DisposablephoneAPIClient
3
+ from unittest.mock import patch
4
+
5
+ class TestDisposablephoneAPIClient(unittest.TestCase):
6
+
7
+ def setUp(self):
8
+ self.api_key = 'test_api_key'
9
+ self.client = DisposablephoneAPIClient(self.api_key)
10
+
11
+ @patch('apiverve_disposablephonenumberchecker.apiClient.requests.get')
12
+ def test_make_request_success(self, mock_get):
13
+ # Assuming there's an endpoint 'test_endpoint' for testing purposes
14
+ mock_get.return_value.status_code = 200
15
+ mock_get.return_value.json.return_value = {'test': 'test'}
16
+ response = self.client.get('test_endpoint')
17
+ self.assertIsInstance(response, dict)
18
+
19
+ @patch('apiverve_disposablephonenumberchecker.apiClient.requests.get')
20
+ def test_make_request_failure(self, mock_get):
21
+ # Assuming there's an endpoint 'test_endpoint' for testing purposes
22
+ mock_get.return_value.status_code = 404
23
+ with self.assertRaises(Exception):
24
+ self.client.get('test_endpoint')
25
+
26
+ if __name__ == '__main__':
27
+ unittest.main()