robosystems-client 0.1.12__py3-none-any.whl → 0.1.14__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.
Files changed (61) hide show
  1. robosystems_client/api/backup/create_backup.py +1 -1
  2. robosystems_client/api/backup/export_backup.py +14 -19
  3. robosystems_client/api/backup/get_backup_download_url.py +1 -1
  4. robosystems_client/api/backup/get_backup_stats.py +19 -1
  5. robosystems_client/api/backup/list_backups.py +19 -1
  6. robosystems_client/api/backup/restore_backup.py +1 -1
  7. robosystems_client/api/copy/copy_data_to_graph.py +479 -0
  8. robosystems_client/api/{credits_ → graph_credits}/check_credit_balance.py +42 -20
  9. robosystems_client/api/graph_health/__init__.py +1 -0
  10. robosystems_client/api/{graph_status → graph_health}/get_database_health.py +1 -1
  11. robosystems_client/api/graph_info/__init__.py +1 -0
  12. robosystems_client/api/{graph_status → graph_info}/get_database_info.py +1 -1
  13. robosystems_client/api/graph_limits/__init__.py +1 -0
  14. robosystems_client/api/graph_limits/get_graph_limits.py +259 -0
  15. robosystems_client/api/subgraphs/create_subgraph.py +63 -173
  16. robosystems_client/api/subgraphs/delete_subgraph.py +14 -14
  17. robosystems_client/api/subgraphs/get_subgraph_info.py +14 -14
  18. robosystems_client/api/subgraphs/get_subgraph_quota.py +8 -4
  19. robosystems_client/api/subgraphs/list_subgraphs.py +39 -75
  20. robosystems_client/api/user/get_all_credit_summaries.py +1 -1
  21. robosystems_client/extensions/README.md +211 -0
  22. robosystems_client/extensions/__init__.py +29 -0
  23. robosystems_client/extensions/copy_client.py +469 -0
  24. robosystems_client/extensions/extensions.py +17 -0
  25. robosystems_client/models/__init__.py +26 -10
  26. robosystems_client/models/copy_response.py +275 -0
  27. robosystems_client/models/{kuzu_backup_health_response_kuzubackuphealth.py → copy_response_error_details_type_0.py} +5 -5
  28. robosystems_client/models/copy_response_status.py +11 -0
  29. robosystems_client/models/custom_schema_definition.py +2 -2
  30. robosystems_client/models/data_frame_copy_request.py +125 -0
  31. robosystems_client/models/data_frame_copy_request_format.py +10 -0
  32. robosystems_client/models/get_graph_limits_response_getgraphlimits.py +44 -0
  33. robosystems_client/models/s3_copy_request.py +378 -0
  34. robosystems_client/models/s3_copy_request_file_format.py +12 -0
  35. robosystems_client/models/s3_copy_request_s3_url_style_type_0.py +9 -0
  36. robosystems_client/models/url_copy_request.py +157 -0
  37. robosystems_client/models/url_copy_request_file_format.py +10 -0
  38. robosystems_client/models/url_copy_request_headers_type_0.py +44 -0
  39. {robosystems_client-0.1.12.dist-info → robosystems_client-0.1.14.dist-info}/METADATA +1 -1
  40. {robosystems_client-0.1.12.dist-info → robosystems_client-0.1.14.dist-info}/RECORD +52 -44
  41. robosystems_client/api/backup/kuzu_backup_health.py +0 -202
  42. robosystems_client/api/billing/get_available_subscription_plans_v1_graph_id_billing_available_plans_get.py +0 -198
  43. robosystems_client/api/billing/get_credit_billing_info_v1_graph_id_billing_credits_get.py +0 -210
  44. robosystems_client/api/billing/get_graph_pricing_info_v1_graph_id_billing_pricing_get.py +0 -198
  45. robosystems_client/api/billing/get_graph_subscription_v1_graph_id_billing_subscription_get.py +0 -198
  46. robosystems_client/api/billing/upgrade_graph_subscription_v1_graph_id_billing_subscription_upgrade_post.py +0 -216
  47. robosystems_client/models/backup_export_request.py +0 -72
  48. robosystems_client/models/credit_check_request.py +0 -82
  49. robosystems_client/models/upgrade_subscription_request.py +0 -82
  50. /robosystems_client/api/{billing → copy}/__init__.py +0 -0
  51. /robosystems_client/api/{credits_ → graph_billing}/__init__.py +0 -0
  52. /robosystems_client/api/{billing → graph_billing}/get_current_graph_bill.py +0 -0
  53. /robosystems_client/api/{billing → graph_billing}/get_graph_billing_history.py +0 -0
  54. /robosystems_client/api/{billing → graph_billing}/get_graph_monthly_bill.py +0 -0
  55. /robosystems_client/api/{billing → graph_billing}/get_graph_usage_details.py +0 -0
  56. /robosystems_client/api/{graph_status → graph_credits}/__init__.py +0 -0
  57. /robosystems_client/api/{credits_ → graph_credits}/check_storage_limits.py +0 -0
  58. /robosystems_client/api/{credits_ → graph_credits}/get_credit_summary.py +0 -0
  59. /robosystems_client/api/{credits_ → graph_credits}/get_storage_usage.py +0 -0
  60. /robosystems_client/api/{credits_ → graph_credits}/list_credit_transactions.py +0 -0
  61. {robosystems_client-0.1.12.dist-info → robosystems_client-0.1.14.dist-info}/WHEEL +0 -0
@@ -11,6 +11,7 @@ The RoboSystems Python Client Extensions provide enhanced functionality for the
11
11
 
12
12
  - **Server-Sent Events (SSE)** streaming with automatic reconnection
13
13
  - **Smart Query Execution** with automatic strategy selection
14
+ - **Data Copy Operations** with S3 import and real-time progress tracking
14
15
  - **Operation Monitoring** for long-running operations
15
16
  - **Connection Pooling** and intelligent resource management
16
17
  - **Result Processing** and format conversion utilities
@@ -84,6 +85,62 @@ async def main():
84
85
  asyncio.run(main())
85
86
  ```
86
87
 
88
+ ### Data Copy Operations
89
+
90
+ ```python
91
+ from robosystems_client.extensions import CopyClient, CopyOptions
92
+ from robosystems_client.models.s3_copy_request import S3CopyRequest
93
+ from robosystems_client.models.s3_copy_request_file_format import S3CopyRequestFileFormat
94
+
95
+ # Initialize copy client
96
+ copy_client = CopyClient({
97
+ "base_url": "https://api.robosystems.ai",
98
+ "api_key": "your-api-key",
99
+ })
100
+
101
+ # Create S3 copy request
102
+ request = S3CopyRequest(
103
+ table_name="companies",
104
+ s3_path="s3://my-bucket/data/companies.csv",
105
+ s3_access_key_id="AWS_ACCESS_KEY",
106
+ s3_secret_access_key="AWS_SECRET_KEY",
107
+ s3_region="us-east-1",
108
+ file_format=S3CopyRequestFileFormat.CSV,
109
+ ignore_errors=False, # Stop on first error
110
+ )
111
+
112
+ # Set up progress callbacks
113
+ def on_progress(message, percent):
114
+ if percent:
115
+ print(f"Progress: {message} ({percent}%)")
116
+ else:
117
+ print(f"Progress: {message}")
118
+
119
+ def on_warning(warning):
120
+ print(f"Warning: {warning}")
121
+
122
+ options = CopyOptions(
123
+ on_progress=on_progress,
124
+ on_warning=on_warning,
125
+ )
126
+
127
+ # Execute copy with progress monitoring
128
+ result = copy_client.copy_from_s3("your_graph_id", request, options)
129
+
130
+ # Check results
131
+ if result.status == "completed":
132
+ print(f"✅ Successfully imported {result.rows_imported:,} rows")
133
+ stats = copy_client.calculate_statistics(result)
134
+ if stats:
135
+ print(f"Throughput: {stats.throughput:.2f} rows/second")
136
+ elif result.status == "partial":
137
+ print(f"⚠️ Imported {result.rows_imported:,} rows, skipped {result.rows_skipped:,}")
138
+ else:
139
+ print(f"❌ Copy failed: {result.error}")
140
+
141
+ copy_client.close()
142
+ ```
143
+
87
144
  ## 🔐 Authentication
88
145
 
89
146
  ### API Key Authentication (Recommended)
@@ -141,6 +198,79 @@ dev_ext = create_extensions(
141
198
 
142
199
  ## 🛠 Advanced Features
143
200
 
201
+ ### Copy Operations with Advanced Features
202
+
203
+ ```python
204
+ from robosystems_client.extensions import CopyClient, CopySourceType
205
+
206
+ # Batch copy multiple tables
207
+ copy_client = CopyClient({
208
+ "base_url": "https://api.robosystems.ai",
209
+ "api_key": "your-api-key",
210
+ })
211
+
212
+ copies = [
213
+ {
214
+ "request": S3CopyRequest(
215
+ table_name="companies",
216
+ s3_path="s3://bucket/companies.csv",
217
+ s3_access_key_id="KEY",
218
+ s3_secret_access_key="SECRET",
219
+ file_format=S3CopyRequestFileFormat.CSV,
220
+ ),
221
+ },
222
+ {
223
+ "request": S3CopyRequest(
224
+ table_name="transactions",
225
+ s3_path="s3://bucket/transactions.parquet",
226
+ s3_access_key_id="KEY",
227
+ s3_secret_access_key="SECRET",
228
+ file_format=S3CopyRequestFileFormat.PARQUET,
229
+ ignore_errors=True, # Continue on errors
230
+ ),
231
+ },
232
+ ]
233
+
234
+ # Execute batch copy
235
+ results = copy_client.batch_copy_from_s3("graph_id", copies)
236
+
237
+ for i, result in enumerate(results):
238
+ table_name = copies[i]["request"].table_name
239
+ print(f"{table_name}: {result.status}")
240
+ if result.rows_imported:
241
+ print(f" Imported: {result.rows_imported:,} rows")
242
+
243
+ # Copy with retry logic for resilient operations
244
+ result = copy_client.copy_with_retry(
245
+ graph_id="graph_id",
246
+ request=S3CopyRequest(
247
+ table_name="large_dataset",
248
+ s3_path="s3://bucket/large-dataset.csv",
249
+ s3_access_key_id="KEY",
250
+ s3_secret_access_key="SECRET",
251
+ max_file_size_gb=50,
252
+ extended_timeout=True,
253
+ ),
254
+ source_type=CopySourceType.S3,
255
+ max_retries=3,
256
+ options=CopyOptions(
257
+ on_progress=lambda msg, _: print(msg)
258
+ ),
259
+ )
260
+
261
+ # Monitor multiple concurrent copy operations
262
+ operation_ids = ["op-123", "op-456", "op-789"]
263
+ results = copy_client.monitor_multiple_copies(operation_ids, options)
264
+
265
+ for op_id, result in results.items():
266
+ print(f"Operation {op_id}: {result.status}")
267
+ if result.status == "completed":
268
+ stats = copy_client.calculate_statistics(result)
269
+ print(f" Throughput: {stats.throughput:.2f} rows/sec")
270
+
271
+ copy_client.close()
272
+ ```
273
+
144
274
  ### Query Builder
145
275
 
146
276
  Build complex Cypher queries programmatically:
@@ -273,6 +403,87 @@ client.close()
273
403
 
274
404
  ## 📊 Examples
275
405
 
406
+ ### Data Import with Real-Time Monitoring
407
+
408
+ ```python
409
+ from robosystems_client.extensions import CopyClient, CopyOptions
410
+ import time
411
+
412
+ def import_financial_data():
413
+ """Import financial data with comprehensive monitoring"""
414
+
415
+ copy_client = CopyClient({
416
+ "base_url": "https://api.robosystems.ai",
417
+ "api_key": "your-api-key",
418
+ })
419
+
420
+ # Track progress history
421
+ progress_history = []
422
+ warnings_count = 0
423
+
424
+ def on_progress(message, percent):
425
+ timestamp = time.strftime("%H:%M:%S")
426
+ progress_history.append({
427
+ "time": timestamp,
428
+ "message": message,
429
+ "percent": percent,
430
+ })
431
+ print(f"[{timestamp}] {message}" + (f" ({percent}%)" if percent else ""))
432
+
433
+ def on_warning(warning):
434
+ nonlocal warnings_count
435
+ warnings_count += 1
436
+ print(f"⚠️ Warning #{warnings_count}: {warning}")
437
+
438
+ def on_queue_update(position, wait_time):
439
+ print(f"📊 Queue position: {position} (ETA: {wait_time}s)")
440
+
441
+ # Configure copy with all callbacks
442
+ options = CopyOptions(
443
+ on_progress=on_progress,
444
+ on_warning=on_warning,
445
+ on_queue_update=on_queue_update,
446
+ timeout=1800000, # 30 minutes
447
+ )
448
+
449
+ # Execute copy operation
450
+ start_time = time.time()
451
+
452
+ result = copy_client.copy_s3(
453
+ graph_id="financial_graph",
454
+ table_name="quarterly_reports",
455
+ s3_path="s3://financial-data/reports-2024-q1.parquet",
456
+ access_key_id="AWS_KEY",
457
+ secret_access_key="AWS_SECRET",
458
+ file_format="parquet",
459
+ ignore_errors=True, # Continue on validation errors
460
+ )
461
+
462
+ # Print summary
463
+ elapsed = time.time() - start_time
464
+
465
+ print("\n" + "="*50)
466
+ print("📈 IMPORT SUMMARY")
467
+ print("="*50)
468
+ print(f"Status: {result.status.upper()}")
469
+ print(f"Rows Imported: {result.rows_imported or 0:,}")
470
+ print(f"Rows Skipped: {result.rows_skipped or 0:,}")
471
+ print(f"Warnings: {warnings_count}")
472
+ print(f"Execution Time: {elapsed:.2f} seconds")
473
+
474
+ if result.status == "completed":
475
+ stats = copy_client.calculate_statistics(result)
476
+ if stats:
477
+ print(f"Throughput: {stats.throughput:.2f} rows/second")
478
+ print(f"Data Processed: {stats.bytes_processed / (1024*1024):.2f} MB")
479
+
480
+ copy_client.close()
481
+ return result
482
+
483
+ # Run the import
484
+ result = import_financial_data()
485
+ ```
486
+
276
487
  ### Financial Data Analysis
277
488
 
278
489
  ```python
@@ -20,6 +20,14 @@ from .operation_client import (
20
20
  OperationProgress,
21
21
  OperationResult,
22
22
  )
23
+ from .copy_client import (
24
+ CopyClient,
25
+ AsyncCopyClient,
26
+ CopySourceType,
27
+ CopyOptions,
28
+ CopyResult,
29
+ CopyStatistics,
30
+ )
23
31
  from .extensions import (
24
32
  RoboSystemsExtensions,
25
33
  RoboSystemsExtensionConfig,
@@ -68,6 +76,13 @@ __all__ = [
68
76
  "OperationStatus",
69
77
  "OperationProgress",
70
78
  "OperationResult",
79
+ # Copy Client
80
+ "CopyClient",
81
+ "AsyncCopyClient",
82
+ "CopySourceType",
83
+ "CopyOptions",
84
+ "CopyResult",
85
+ "CopyStatistics",
71
86
  # Utilities
72
87
  "QueryBuilder",
73
88
  "ResultProcessor",
@@ -106,3 +121,17 @@ def execute_query(graph_id: str, query: str, parameters=None):
106
121
  def stream_query(graph_id: str, query: str, parameters=None, chunk_size=None):
107
122
  """Stream a query using the default extensions instance"""
108
123
  return extensions.query.stream_query(graph_id, query, parameters, chunk_size)
124
+
125
+
126
+ def copy_from_s3(
127
+ graph_id: str,
128
+ table_name: str,
129
+ s3_path: str,
130
+ access_key_id: str,
131
+ secret_access_key: str,
132
+ **kwargs,
133
+ ):
134
+ """Copy data from S3 using the default extensions instance"""
135
+ return extensions.copy_from_s3(
136
+ graph_id, table_name, s3_path, access_key_id, secret_access_key, **kwargs
137
+ )