apiverve-testcardgenerator 1.2.0__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.
@@ -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,409 @@
1
+ Metadata-Version: 2.4
2
+ Name: apiverve-testcardgenerator
3
+ Version: 1.2.0
4
+ Summary: Card Generator is a simple tool for generating test/sample card numbers. It returns a list of card numbers for testing.
5
+ Author-email: APIVerve <hello@apiverve.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://apiverve.com?utm_source=pypi
8
+ Project-URL: Repository, https://github.com/apiverve/cardgenerator-api
9
+ Project-URL: Documentation, https://docs.apiverve.com/api/cardgenerator?utm_source=pypi
10
+ Project-URL: Twitter, https://twitter.com/apivervehq
11
+ Keywords: card generator,card generator api,card generator tool,card generator software,card generator service
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: 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.9
42
+ Description-Content-Type: text/markdown
43
+ License-File: LICENSE
44
+ Requires-Dist: requests>=2.25.0
45
+ Dynamic: license-file
46
+
47
+ Test Card Generator API
48
+ ============
49
+
50
+ Card Generator is a simple tool for generating test/sample card numbers. It returns a list of card numbers for testing.
51
+
52
+ ![Build Status](https://img.shields.io/badge/build-passing-green)
53
+ ![Code Climate](https://img.shields.io/badge/maintainability-B-purple)
54
+ ![Prod Ready](https://img.shields.io/badge/production-ready-blue)
55
+
56
+ This is a Python API Wrapper for the [Test Card Generator API](https://apiverve.com/marketplace/cardgenerator?utm_source=pypi&utm_medium=readme)
57
+
58
+ ---
59
+
60
+ ## Installation
61
+
62
+ Using `pip`:
63
+
64
+ ```bash
65
+ pip install apiverve-testcardgenerator
66
+ ```
67
+
68
+ Using `pip3`:
69
+
70
+ ```bash
71
+ pip3 install apiverve-testcardgenerator
72
+ ```
73
+
74
+ ---
75
+
76
+ ## Configuration
77
+
78
+ Before using the cardgenerator API client, you have to setup your account and obtain your API Key.
79
+ You can get it by signing up at [https://apiverve.com](https://apiverve.com?utm_source=pypi&utm_medium=readme)
80
+
81
+ ---
82
+
83
+ ## Quick Start
84
+
85
+ Here's a simple example to get you started quickly:
86
+
87
+ ```python
88
+ from apiverve_testcardgenerator.apiClient import CardgeneratorAPIClient
89
+
90
+ # Initialize the client with your APIVerve API key
91
+ api = CardgeneratorAPIClient("[YOUR_API_KEY]")
92
+
93
+ query = {
94
+ "brand": "visa",
95
+ "count": 1,
96
+ "includeAvatar": true
97
+ }
98
+
99
+ try:
100
+ # Make the API call
101
+ result = api.execute(query)
102
+
103
+ # Print the result
104
+ print(result)
105
+ except Exception as e:
106
+ print(f"Error: {e}")
107
+ ```
108
+
109
+ ---
110
+
111
+ ## Usage
112
+
113
+ The Test Card Generator API documentation is found here: [https://docs.apiverve.com/ref/cardgenerator](https://docs.apiverve.com/ref/cardgenerator?utm_source=pypi&utm_medium=readme).
114
+ You can find parameters, example responses, and status codes documented here.
115
+
116
+ ### Setup
117
+
118
+ ```python
119
+ # Import the client module
120
+ from apiverve_testcardgenerator.apiClient import CardgeneratorAPIClient
121
+
122
+ # Initialize the client with your APIVerve API key
123
+ api = CardgeneratorAPIClient("[YOUR_API_KEY]")
124
+ ```
125
+
126
+ ---
127
+
128
+ ## Perform Request
129
+
130
+ Using the API client, you can perform requests to the API.
131
+
132
+ ###### Define Query
133
+
134
+ ```python
135
+ query = {
136
+ "brand": "visa",
137
+ "count": 1,
138
+ "includeAvatar": true
139
+ }
140
+ ```
141
+
142
+ ###### Simple Request
143
+
144
+ ```python
145
+ # Make a request to the API
146
+ result = api.execute(query)
147
+
148
+ # Print the result
149
+ print(result)
150
+ ```
151
+
152
+ ###### Example Response
153
+
154
+ ```json
155
+ {
156
+ "status": "ok",
157
+ "error": null,
158
+ "data": {
159
+ "brand": "visa",
160
+ "count": 5,
161
+ "cards": [
162
+ {
163
+ "cvv": 175,
164
+ "issuer": "SOUTHEAST F.C.U.",
165
+ "id": "0faca124-9a33-4ac6-a3df-8bf103025779",
166
+ "number": "4750377207233152",
167
+ "expiration": "12/2030",
168
+ "brand": "visa",
169
+ "number_alt": {
170
+ "masked": "************3152",
171
+ "unmasked": "4750 3772 0723 3152",
172
+ "last4": "3152"
173
+ }
174
+ },
175
+ {
176
+ "cvv": 129,
177
+ "issuer": "U.S. BANK, N.A.",
178
+ "id": "0d074efe-69e2-4e30-b49a-4cead1ea8411",
179
+ "number": "4431387818727358",
180
+ "expiration": "12/2030",
181
+ "brand": "visa",
182
+ "number_alt": {
183
+ "masked": "************7358",
184
+ "unmasked": "4431 3878 1872 7358",
185
+ "last4": "7358"
186
+ }
187
+ },
188
+ {
189
+ "cvv": 249,
190
+ "issuer": "AUGUSTA VAH F.C.U.",
191
+ "id": "2f01f458-7422-400e-bbcf-41364564193b",
192
+ "number": "4425919427248836",
193
+ "expiration": "12/2030",
194
+ "brand": "visa",
195
+ "number_alt": {
196
+ "masked": "************8836",
197
+ "unmasked": "4425 9194 2724 8836",
198
+ "last4": "8836"
199
+ }
200
+ },
201
+ {
202
+ "cvv": 892,
203
+ "issuer": "CITIZENS SECURITY BANK AND TRUST COMPANY",
204
+ "id": "d311e9d0-f410-4f75-a21f-f14125c88cbb",
205
+ "number": "4127737519045634",
206
+ "expiration": "12/2030",
207
+ "brand": "visa",
208
+ "number_alt": {
209
+ "masked": "************5634",
210
+ "unmasked": "4127 7375 1904 5634",
211
+ "last4": "5634"
212
+ }
213
+ },
214
+ {
215
+ "cvv": 524,
216
+ "issuer": "CREDIT LIBANAIS S.A.L.",
217
+ "id": "64113f4d-c625-43d2-9d82-04f220c9e26f",
218
+ "number": "4741441509416816",
219
+ "expiration": "12/2030",
220
+ "brand": "visa",
221
+ "number_alt": {
222
+ "masked": "************6816",
223
+ "unmasked": "4741 4415 0941 6816",
224
+ "last4": "6816"
225
+ }
226
+ }
227
+ ],
228
+ "owner": {
229
+ "name": "Benny Swaniawski",
230
+ "address": {
231
+ "street": "007 Nelson Mountains",
232
+ "city": "Margueriteton",
233
+ "state": "Washington",
234
+ "zipCode": "39956-7950"
235
+ },
236
+ "avatar": "https://storage.googleapis.com/apiverve/APIResources/faces/Male/30-40/12345678.jpg?X-Goog-Signature=..."
237
+ }
238
+ }
239
+ }
240
+ ```
241
+
242
+ ---
243
+
244
+ ## Error Handling
245
+
246
+ The API client provides comprehensive error handling through the `CardgeneratorAPIClientError` exception. Here are some examples:
247
+
248
+ ### Basic Error Handling
249
+
250
+ ```python
251
+ from apiverve_testcardgenerator.apiClient import CardgeneratorAPIClient, CardgeneratorAPIClientError
252
+
253
+ api = CardgeneratorAPIClient("[YOUR_API_KEY]")
254
+
255
+ query = {
256
+ "brand": "visa",
257
+ "count": 1,
258
+ "includeAvatar": true
259
+ }
260
+
261
+ try:
262
+ result = api.execute(query)
263
+ print("Success!")
264
+ print(result)
265
+ except CardgeneratorAPIClientError as e:
266
+ print(f"API Error: {e.message}")
267
+ if e.status_code:
268
+ print(f"Status Code: {e.status_code}")
269
+ if e.response:
270
+ print(f"Response: {e.response}")
271
+ ```
272
+
273
+ ### Handling Specific Error Types
274
+
275
+ ```python
276
+ from apiverve_testcardgenerator.apiClient import CardgeneratorAPIClient, CardgeneratorAPIClientError
277
+
278
+ api = CardgeneratorAPIClient("[YOUR_API_KEY]")
279
+
280
+ query = {
281
+ "brand": "visa",
282
+ "count": 1,
283
+ "includeAvatar": true
284
+ }
285
+
286
+ try:
287
+ result = api.execute(query)
288
+
289
+ # Check for successful response
290
+ if result.get('status') == 'success':
291
+ print("Request successful!")
292
+ print(result.get('data'))
293
+ else:
294
+ print(f"API returned an error: {result.get('error')}")
295
+
296
+ except CardgeneratorAPIClientError as e:
297
+ # Handle API client errors
298
+ if e.status_code == 401:
299
+ print("Unauthorized: Invalid API key")
300
+ elif e.status_code == 429:
301
+ print("Rate limit exceeded")
302
+ elif e.status_code >= 500:
303
+ print("Server error - please try again later")
304
+ else:
305
+ print(f"API error: {e.message}")
306
+ except Exception as e:
307
+ # Handle unexpected errors
308
+ print(f"Unexpected error: {str(e)}")
309
+ ```
310
+
311
+ ### Using Context Manager (Recommended)
312
+
313
+ The client supports the context manager protocol for automatic resource cleanup:
314
+
315
+ ```python
316
+ from apiverve_testcardgenerator.apiClient import CardgeneratorAPIClient, CardgeneratorAPIClientError
317
+
318
+ query = {
319
+ "brand": "visa",
320
+ "count": 1,
321
+ "includeAvatar": true
322
+ }
323
+
324
+ # Using context manager ensures proper cleanup
325
+ with CardgeneratorAPIClient("[YOUR_API_KEY]") as api:
326
+ try:
327
+ result = api.execute(query)
328
+ print(result)
329
+ except CardgeneratorAPIClientError as e:
330
+ print(f"Error: {e.message}")
331
+ # Session is automatically closed here
332
+ ```
333
+
334
+ ---
335
+
336
+ ## Advanced Features
337
+
338
+ ### Debug Mode
339
+
340
+ Enable debug logging to see detailed request and response information:
341
+
342
+ ```python
343
+ from apiverve_testcardgenerator.apiClient import CardgeneratorAPIClient
344
+
345
+ # Enable debug mode
346
+ api = CardgeneratorAPIClient("[YOUR_API_KEY]", debug=True)
347
+
348
+ query = {
349
+ "brand": "visa",
350
+ "count": 1,
351
+ "includeAvatar": true
352
+ }
353
+
354
+ # Debug information will be printed to console
355
+ result = api.execute(query)
356
+ ```
357
+
358
+ ### Manual Session Management
359
+
360
+ If you need to manually manage the session lifecycle:
361
+
362
+ ```python
363
+ from apiverve_testcardgenerator.apiClient import CardgeneratorAPIClient
364
+
365
+ api = CardgeneratorAPIClient("[YOUR_API_KEY]")
366
+
367
+ query = {
368
+ "brand": "visa",
369
+ "count": 1,
370
+ "includeAvatar": true
371
+ }
372
+
373
+ try:
374
+ result = api.execute(query)
375
+ print(result)
376
+ finally:
377
+ # Manually close the session when done
378
+ api.close()
379
+ ```
380
+
381
+ ---
382
+
383
+ ## Customer Support
384
+
385
+ Need any assistance? [Get in touch with Customer Support](https://apiverve.com/contact?utm_source=pypi&utm_medium=readme).
386
+
387
+ ---
388
+
389
+ ## Updates
390
+ Stay up to date by following [@apiverveHQ](https://twitter.com/apiverveHQ) on Twitter.
391
+
392
+ ---
393
+
394
+ ## Legal
395
+
396
+ 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=readme) and all legal documents and agreements.
397
+
398
+ ---
399
+
400
+ ## License
401
+ Licensed under the The MIT License (MIT)
402
+
403
+ Copyright (&copy;) 2026 APIVerve, and EvlarSoft LLC
404
+
405
+ 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:
406
+
407
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
408
+
409
+ 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.