indro-sdk 1.0.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.
- indro_sdk-1.0.0/PKG-INFO +544 -0
- indro_sdk-1.0.0/README.md +508 -0
- indro_sdk-1.0.0/indro_sdk.egg-info/PKG-INFO +544 -0
- indro_sdk-1.0.0/indro_sdk.egg-info/SOURCES.txt +9 -0
- indro_sdk-1.0.0/indro_sdk.egg-info/dependency_links.txt +1 -0
- indro_sdk-1.0.0/indro_sdk.egg-info/entry_points.txt +2 -0
- indro_sdk-1.0.0/indro_sdk.egg-info/not-zip-safe +1 -0
- indro_sdk-1.0.0/indro_sdk.egg-info/requires.txt +12 -0
- indro_sdk-1.0.0/indro_sdk.egg-info/top_level.txt +1 -0
- indro_sdk-1.0.0/setup.cfg +4 -0
- indro_sdk-1.0.0/setup.py +55 -0
indro_sdk-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,544 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: indro-sdk
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Production-ready SDK for the Indro Edge API
|
|
5
|
+
Home-page: https://abhinav337463-indro-edge-api.hf.space
|
|
6
|
+
Author: Abhinav Anand
|
|
7
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
8
|
+
Classifier: Intended Audience :: Developers
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
Requires-Dist: httpx>=0.27.0
|
|
19
|
+
Provides-Extra: ws
|
|
20
|
+
Requires-Dist: websockets>=12.0; extra == "ws"
|
|
21
|
+
Provides-Extra: keyring
|
|
22
|
+
Requires-Dist: keyring>=24.0.0; extra == "keyring"
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: pytest>=8.0.0; extra == "dev"
|
|
25
|
+
Requires-Dist: ruff>=0.5.0; extra == "dev"
|
|
26
|
+
Requires-Dist: mypy>=1.8.0; extra == "dev"
|
|
27
|
+
Dynamic: author
|
|
28
|
+
Dynamic: classifier
|
|
29
|
+
Dynamic: description
|
|
30
|
+
Dynamic: description-content-type
|
|
31
|
+
Dynamic: home-page
|
|
32
|
+
Dynamic: provides-extra
|
|
33
|
+
Dynamic: requires-dist
|
|
34
|
+
Dynamic: requires-python
|
|
35
|
+
Dynamic: summary
|
|
36
|
+
|
|
37
|
+
Indro SDK
|
|
38
|
+
|
|
39
|
+
Production-ready Python SDK for the Indro Edge API.
|
|
40
|
+
|
|
41
|
+
The Indro SDK provides a secure, high-performance, enterprise-grade client for interacting with the Indro Edge inference platform.
|
|
42
|
+
|
|
43
|
+
Base API Endpoint:
|
|
44
|
+
|
|
45
|
+
https://abhinav337463-indro-edge-api.hf.space
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
Features
|
|
50
|
+
|
|
51
|
+
Core Features
|
|
52
|
+
|
|
53
|
+
- Fully typed API
|
|
54
|
+
- Automatic request serialization
|
|
55
|
+
- Automatic response parsing
|
|
56
|
+
- GET, POST, PUT, PATCH, DELETE support
|
|
57
|
+
- JSON requests
|
|
58
|
+
- Form data requests
|
|
59
|
+
- Multipart file uploads
|
|
60
|
+
- Streaming response support
|
|
61
|
+
- Connection pooling
|
|
62
|
+
- Keep-alive support
|
|
63
|
+
- Batch request support
|
|
64
|
+
- Request cancellation
|
|
65
|
+
- Request deduplication
|
|
66
|
+
- Offline request queue
|
|
67
|
+
- Middleware system
|
|
68
|
+
- Interceptor system
|
|
69
|
+
- Plugin system
|
|
70
|
+
- Event hooks
|
|
71
|
+
- Fluent API design
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
Security Features
|
|
76
|
+
|
|
77
|
+
- API Key Authentication
|
|
78
|
+
- Bearer Token Authentication
|
|
79
|
+
- Custom Header Authentication
|
|
80
|
+
- Secure HTTPS enforcement
|
|
81
|
+
- SSL validation
|
|
82
|
+
- Request signing
|
|
83
|
+
- HMAC support
|
|
84
|
+
- Header sanitization
|
|
85
|
+
- Input sanitization
|
|
86
|
+
- Output sanitization
|
|
87
|
+
- Secret masking in logs
|
|
88
|
+
- Anti-injection protections
|
|
89
|
+
- Secure error handling
|
|
90
|
+
- Environment variable support
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
Performance Features
|
|
95
|
+
|
|
96
|
+
- In-memory cache
|
|
97
|
+
- Persistent cache
|
|
98
|
+
- Smart cache invalidation
|
|
99
|
+
- Compression support
|
|
100
|
+
- Lazy loading
|
|
101
|
+
- Request prioritization
|
|
102
|
+
- Concurrent request management
|
|
103
|
+
- Queue management
|
|
104
|
+
- Optimized memory usage
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
Monitoring Features
|
|
109
|
+
|
|
110
|
+
- Request metrics
|
|
111
|
+
- Performance metrics
|
|
112
|
+
- Latency tracking
|
|
113
|
+
- Correlation IDs
|
|
114
|
+
- Request tracing
|
|
115
|
+
- Error tracking
|
|
116
|
+
- Health checks
|
|
117
|
+
- Telemetry hooks
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
Installation
|
|
122
|
+
|
|
123
|
+
Install directly:
|
|
124
|
+
|
|
125
|
+
pip install indro
|
|
126
|
+
|
|
127
|
+
Development installation:
|
|
128
|
+
|
|
129
|
+
pip install indro[dev]
|
|
130
|
+
|
|
131
|
+
WebSocket support:
|
|
132
|
+
|
|
133
|
+
pip install indro[ws]
|
|
134
|
+
|
|
135
|
+
Secure token storage support:
|
|
136
|
+
|
|
137
|
+
pip install indro[keyring]
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
Quick Start
|
|
142
|
+
|
|
143
|
+
from main import IndroClient
|
|
144
|
+
|
|
145
|
+
client = IndroClient()
|
|
146
|
+
|
|
147
|
+
result = client.predict(
|
|
148
|
+
model_name="house-price-model",
|
|
149
|
+
features=[
|
|
150
|
+
1200,
|
|
151
|
+
3,
|
|
152
|
+
2,
|
|
153
|
+
5
|
|
154
|
+
]
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
print(result.prediction)
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
Initialization
|
|
162
|
+
|
|
163
|
+
Basic:
|
|
164
|
+
|
|
165
|
+
from main import IndroClient
|
|
166
|
+
|
|
167
|
+
client = IndroClient()
|
|
168
|
+
|
|
169
|
+
Custom endpoint:
|
|
170
|
+
|
|
171
|
+
client = IndroClient(
|
|
172
|
+
base_url="https://abhinav337463-indro-edge-api.hf.space"
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
Debug mode:
|
|
176
|
+
|
|
177
|
+
client = IndroClient(
|
|
178
|
+
debug=True
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
Verbose logging:
|
|
182
|
+
|
|
183
|
+
client = IndroClient(
|
|
184
|
+
verbose=True
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
Authentication
|
|
190
|
+
|
|
191
|
+
API Key
|
|
192
|
+
|
|
193
|
+
client = IndroClient(
|
|
194
|
+
api_key="YOUR_API_KEY"
|
|
195
|
+
)
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
Bearer Token
|
|
200
|
+
|
|
201
|
+
client = IndroClient(
|
|
202
|
+
bearer_token="YOUR_TOKEN"
|
|
203
|
+
)
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
Custom Headers
|
|
208
|
+
|
|
209
|
+
client = IndroClient(
|
|
210
|
+
headers={
|
|
211
|
+
"X-Custom": "value"
|
|
212
|
+
}
|
|
213
|
+
)
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
Available API Methods
|
|
218
|
+
|
|
219
|
+
List Models
|
|
220
|
+
|
|
221
|
+
Maps to:
|
|
222
|
+
|
|
223
|
+
GET /api/models
|
|
224
|
+
|
|
225
|
+
Example:
|
|
226
|
+
|
|
227
|
+
models = client.models()
|
|
228
|
+
|
|
229
|
+
print(models.models)
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
Predict
|
|
234
|
+
|
|
235
|
+
Maps to:
|
|
236
|
+
|
|
237
|
+
POST /api/predict
|
|
238
|
+
|
|
239
|
+
Example:
|
|
240
|
+
|
|
241
|
+
response = client.predict(
|
|
242
|
+
model_name="house-price-model",
|
|
243
|
+
features=[
|
|
244
|
+
1200,
|
|
245
|
+
3,
|
|
246
|
+
2,
|
|
247
|
+
5
|
|
248
|
+
]
|
|
249
|
+
)
|
|
250
|
+
|
|
251
|
+
print(response.prediction)
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
Async Predict
|
|
256
|
+
|
|
257
|
+
response = await client.predict_async(
|
|
258
|
+
model_name="house-price-model",
|
|
259
|
+
features=[1,2,3,4]
|
|
260
|
+
)
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
Batch Requests
|
|
265
|
+
|
|
266
|
+
responses = client.batch_predict([
|
|
267
|
+
{
|
|
268
|
+
"model_name": "model-a",
|
|
269
|
+
"features": [1,2,3]
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"model_name": "model-b",
|
|
273
|
+
"features": [4,5,6]
|
|
274
|
+
}
|
|
275
|
+
])
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
Health Checks
|
|
280
|
+
|
|
281
|
+
The SDK includes helpers for operational endpoints.
|
|
282
|
+
|
|
283
|
+
Health
|
|
284
|
+
|
|
285
|
+
health = client.health()
|
|
286
|
+
|
|
287
|
+
Endpoint:
|
|
288
|
+
|
|
289
|
+
GET /health
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
Readiness
|
|
294
|
+
|
|
295
|
+
ready = client.ready()
|
|
296
|
+
|
|
297
|
+
Endpoint:
|
|
298
|
+
|
|
299
|
+
GET /ready
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
Metrics
|
|
304
|
+
|
|
305
|
+
metrics = client.metrics()
|
|
306
|
+
|
|
307
|
+
Endpoint:
|
|
308
|
+
|
|
309
|
+
GET /metrics
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
SLO Dashboard
|
|
314
|
+
|
|
315
|
+
slo = client.slo()
|
|
316
|
+
|
|
317
|
+
Endpoint:
|
|
318
|
+
|
|
319
|
+
GET /slo
|
|
320
|
+
|
|
321
|
+
---
|
|
322
|
+
|
|
323
|
+
Caching
|
|
324
|
+
|
|
325
|
+
Enable memory cache:
|
|
326
|
+
|
|
327
|
+
client = IndroClient(
|
|
328
|
+
cache_enabled=True
|
|
329
|
+
)
|
|
330
|
+
|
|
331
|
+
Custom TTL:
|
|
332
|
+
|
|
333
|
+
client = IndroClient(
|
|
334
|
+
cache_ttl=300
|
|
335
|
+
)
|
|
336
|
+
|
|
337
|
+
Clear cache:
|
|
338
|
+
|
|
339
|
+
client.cache.clear()
|
|
340
|
+
|
|
341
|
+
---
|
|
342
|
+
|
|
343
|
+
Retry System
|
|
344
|
+
|
|
345
|
+
Automatic retry support:
|
|
346
|
+
|
|
347
|
+
client = IndroClient(
|
|
348
|
+
retries=5
|
|
349
|
+
)
|
|
350
|
+
|
|
351
|
+
Exponential backoff:
|
|
352
|
+
|
|
353
|
+
client = IndroClient(
|
|
354
|
+
retry_backoff_factor=2
|
|
355
|
+
)
|
|
356
|
+
|
|
357
|
+
---
|
|
358
|
+
|
|
359
|
+
Timeout Management
|
|
360
|
+
|
|
361
|
+
client = IndroClient(
|
|
362
|
+
timeout=60
|
|
363
|
+
)
|
|
364
|
+
|
|
365
|
+
Per request:
|
|
366
|
+
|
|
367
|
+
client.predict(
|
|
368
|
+
model_name="my-model",
|
|
369
|
+
features=[1,2,3],
|
|
370
|
+
timeout=120
|
|
371
|
+
)
|
|
372
|
+
|
|
373
|
+
---
|
|
374
|
+
|
|
375
|
+
Middleware
|
|
376
|
+
|
|
377
|
+
def middleware(request):
|
|
378
|
+
print(request.url)
|
|
379
|
+
return request
|
|
380
|
+
|
|
381
|
+
client.add_middleware(middleware)
|
|
382
|
+
|
|
383
|
+
---
|
|
384
|
+
|
|
385
|
+
Interceptors
|
|
386
|
+
|
|
387
|
+
Request interceptor:
|
|
388
|
+
|
|
389
|
+
client.interceptors.request.use(
|
|
390
|
+
lambda req: req
|
|
391
|
+
)
|
|
392
|
+
|
|
393
|
+
Response interceptor:
|
|
394
|
+
|
|
395
|
+
client.interceptors.response.use(
|
|
396
|
+
lambda res: res
|
|
397
|
+
)
|
|
398
|
+
|
|
399
|
+
---
|
|
400
|
+
|
|
401
|
+
Event Hooks
|
|
402
|
+
|
|
403
|
+
@client.on("request")
|
|
404
|
+
def on_request(event):
|
|
405
|
+
print(event)
|
|
406
|
+
|
|
407
|
+
@client.on("response")
|
|
408
|
+
def on_response(event):
|
|
409
|
+
print(event)
|
|
410
|
+
|
|
411
|
+
@client.on("error")
|
|
412
|
+
def on_error(event):
|
|
413
|
+
print(event)
|
|
414
|
+
|
|
415
|
+
---
|
|
416
|
+
|
|
417
|
+
Error Handling
|
|
418
|
+
|
|
419
|
+
Base error:
|
|
420
|
+
|
|
421
|
+
from main import IndroSDKError
|
|
422
|
+
|
|
423
|
+
Authentication:
|
|
424
|
+
|
|
425
|
+
from main import AuthenticationError
|
|
426
|
+
|
|
427
|
+
Validation:
|
|
428
|
+
|
|
429
|
+
from main import ValidationError
|
|
430
|
+
|
|
431
|
+
Timeout:
|
|
432
|
+
|
|
433
|
+
from main import TimeoutError
|
|
434
|
+
|
|
435
|
+
Network:
|
|
436
|
+
|
|
437
|
+
from main import NetworkError
|
|
438
|
+
|
|
439
|
+
Server:
|
|
440
|
+
|
|
441
|
+
from main import ServerError
|
|
442
|
+
|
|
443
|
+
Retry exhaustion:
|
|
444
|
+
|
|
445
|
+
from main import RetryExhaustedError
|
|
446
|
+
|
|
447
|
+
Example:
|
|
448
|
+
|
|
449
|
+
try:
|
|
450
|
+
client.predict(
|
|
451
|
+
model_name="demo",
|
|
452
|
+
features=[1,2,3]
|
|
453
|
+
)
|
|
454
|
+
except ValidationError:
|
|
455
|
+
pass
|
|
456
|
+
except NetworkError:
|
|
457
|
+
pass
|
|
458
|
+
|
|
459
|
+
---
|
|
460
|
+
|
|
461
|
+
Environment Variables
|
|
462
|
+
|
|
463
|
+
INDRO_BASE_URL=https://abhinav337463-indro-edge-api.hf.space
|
|
464
|
+
|
|
465
|
+
INDRO_API_KEY=your_api_key
|
|
466
|
+
|
|
467
|
+
INDRO_BEARER_TOKEN=your_token
|
|
468
|
+
|
|
469
|
+
INDRO_TIMEOUT=60
|
|
470
|
+
|
|
471
|
+
INDRO_DEBUG=false
|
|
472
|
+
|
|
473
|
+
---
|
|
474
|
+
|
|
475
|
+
Production Recommendations
|
|
476
|
+
|
|
477
|
+
For production deployments:
|
|
478
|
+
|
|
479
|
+
client = IndroClient(
|
|
480
|
+
timeout=60,
|
|
481
|
+
retries=5,
|
|
482
|
+
cache_enabled=True,
|
|
483
|
+
verify_ssl=True,
|
|
484
|
+
keep_alive=True,
|
|
485
|
+
compression=True
|
|
486
|
+
)
|
|
487
|
+
|
|
488
|
+
---
|
|
489
|
+
|
|
490
|
+
API Compatibility
|
|
491
|
+
|
|
492
|
+
Compatible with:
|
|
493
|
+
|
|
494
|
+
- Indro Edge API v3.x
|
|
495
|
+
- Future v3 minor releases
|
|
496
|
+
- Backward compatibility layer included
|
|
497
|
+
|
|
498
|
+
---
|
|
499
|
+
|
|
500
|
+
Thread Safety
|
|
501
|
+
|
|
502
|
+
The SDK is designed to be thread-safe and suitable for:
|
|
503
|
+
|
|
504
|
+
- Web servers
|
|
505
|
+
- FastAPI
|
|
506
|
+
- Django
|
|
507
|
+
- Flask
|
|
508
|
+
- Background workers
|
|
509
|
+
- Microservices
|
|
510
|
+
- Enterprise applications
|
|
511
|
+
|
|
512
|
+
---
|
|
513
|
+
|
|
514
|
+
License
|
|
515
|
+
|
|
516
|
+
MIT License
|
|
517
|
+
|
|
518
|
+
Copyright (c) 2026
|
|
519
|
+
|
|
520
|
+
Abhinav Anand
|
|
521
|
+
|
|
522
|
+
---
|
|
523
|
+
|
|
524
|
+
Example
|
|
525
|
+
|
|
526
|
+
from main import IndroClient
|
|
527
|
+
|
|
528
|
+
client = IndroClient(
|
|
529
|
+
debug=True,
|
|
530
|
+
cache_enabled=True
|
|
531
|
+
)
|
|
532
|
+
|
|
533
|
+
models = client.models()
|
|
534
|
+
|
|
535
|
+
print(models.models)
|
|
536
|
+
|
|
537
|
+
prediction = client.predict(
|
|
538
|
+
model_name=models.models[0],
|
|
539
|
+
features=[1.0, 2.0, 3.0, 4.0]
|
|
540
|
+
)
|
|
541
|
+
|
|
542
|
+
print(prediction)
|
|
543
|
+
|
|
544
|
+
Built for the Indro Edge ecosystem.
|