cloudkit 0.1.0__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,421 @@
1
+ Metadata-Version: 2.4
2
+ Name: cloudkit
3
+ Version: 0.1.0
4
+ Summary: Python cloud abstraction SDK for databases and AI services on Azure and AWS
5
+ Author-email: sleepeatai <sleepeatai@gmail.com>
6
+ License: MIT
7
+ License-File: LICENSE
8
+ Keywords: abstraction,ai,aws,azure,cloud,database,multi-cloud,sdk
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Topic :: Internet
16
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
17
+ Requires-Python: >=3.11
18
+ Requires-Dist: aioboto3>=12.3.0
19
+ Requires-Dist: asyncio-throttle>=1.0.2
20
+ Requires-Dist: azure-ai-textanalytics>=5.3.0
21
+ Requires-Dist: azure-cosmos>=4.5.1
22
+ Requires-Dist: azure-data-tables>=12.4.4
23
+ Requires-Dist: azure-search-documents>=11.4.0
24
+ Requires-Dist: azure-servicebus>=7.11.4
25
+ Requires-Dist: azure-storage-blob>=12.19.0
26
+ Requires-Dist: boto3>=1.34.0
27
+ Requires-Dist: httpx>=0.28.1
28
+ Requires-Dist: jinja2>=3.1.5
29
+ Requires-Dist: openai>=1.8.0
30
+ Requires-Dist: orjson>=3.10.15
31
+ Requires-Dist: pydantic-settings>=2.7.1
32
+ Requires-Dist: pydantic>=2.10.6
33
+ Requires-Dist: pyyaml>=6.0.2
34
+ Description-Content-Type: text/markdown
35
+
36
+ # Agentic Composer SDK
37
+
38
+ A Python cloud abstraction SDK that provides a unified interface for databases and AI services across Azure and AWS. This SDK allows you to build cloud-agnostic microservices that can easily switch between cloud providers without changing your application code.
39
+
40
+ ## Features
41
+
42
+ ### πŸ—„οΈ Database Services
43
+ - **Azure**: Cosmos DB (NoSQL & Table API), Blob Storage
44
+ - **AWS**: DynamoDB, S3
45
+
46
+ ### πŸ€– AI Services
47
+ - **Text Analysis**: Sentiment analysis, entity recognition, key phrase extraction
48
+ - **Chat Completion**: GPT models via Azure OpenAI or AWS Bedrock
49
+ - **Embeddings**: Text-to-vector conversion for similarity search
50
+ - **Search**: Azure Cognitive Search or AWS OpenSearch
51
+
52
+ ### πŸ“¨ Messaging Services
53
+ - **Azure**: Service Bus
54
+ - **AWS**: SQS
55
+
56
+ ## Installation
57
+
58
+ 1. Install required tools:
59
+ ```bash
60
+ python3 -m pip install keyring artifacts-keyring
61
+ ```
62
+
63
+ 2. Configure Azure Artifacts authentication:
64
+ ```bash
65
+ keyring set artifacts.dev.azure.com Consulting-DTT-AI-Integration-Services <your-PAT>
66
+ ```
67
+
68
+ 3. Install the package:
69
+ ```bash
70
+ python3 -m pip install cloudabstractor
71
+ ```
72
+
73
+ ```bash
74
+ # Install from source
75
+ git clone <repository-url>
76
+ cd agentic-composer-sdk
77
+ pip install -e .
78
+
79
+ # Or install from PyPI (once published)
80
+ pip install agentic-composer-sdk
81
+ ```
82
+
83
+ ## Quick Start
84
+
85
+ ```python
86
+ import asyncio
87
+ from agentic_composer_sdk import CloudProvider
88
+
89
+ async def main():
90
+ # Initialize for Azure
91
+ azure_config = {
92
+ "cloud_provider": "azure",
93
+ "azure_openai_api_key": "your-key",
94
+ "azure_openai_endpoint": "your-endpoint",
95
+ "azure_storage_connection_string": "your-connection-string"
96
+ }
97
+
98
+ cloud = CloudProvider(provider_type="azure", config=azure_config)
99
+
100
+ # Use AI services
101
+ sentiment = await cloud.analyze_text_sentiment("I love this SDK!")
102
+ print(f"Sentiment: {sentiment}")
103
+
104
+ # Store files
105
+ await cloud.store_file("data/document.txt", b"Hello World!")
106
+
107
+ # Chat with AI
108
+ messages = [{"role": "user", "content": "What is cloud computing?"}]
109
+ response = await cloud.chat_with_ai(messages)
110
+ print(response['choices'][0]['message']['content'])
111
+
112
+ asyncio.run(main())
113
+ ```
114
+
115
+ ## Architecture
116
+
117
+ The SDK uses an abstract interface pattern to provide cloud-agnostic services:
118
+
119
+ ```
120
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
121
+ β”‚ Your App β”‚ β”‚ CloudProvider β”‚
122
+ β”‚ │◄──►│ β”‚
123
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
124
+ β”‚
125
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
126
+ β”‚ β”‚ β”‚
127
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β” β”Œβ”€β”€β”€β”€β–Όβ”€β”€β” β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”
128
+ β”‚ Azure β”‚ β”‚ AWS β”‚ β”‚ Future β”‚
129
+ β”‚ Services β”‚ β”‚Servicesβ”‚ β”‚ Providersβ”‚
130
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
131
+ ```
132
+
133
+ ## Configuration
134
+
135
+ ### Environment Variables
136
+
137
+ You can configure the SDK using environment variables:
138
+
139
+ ```bash
140
+ # Azure Configuration
141
+ export CLOUD_SDK_CLOUD_PROVIDER=azure
142
+ export CLOUD_SDK_AZURE__AZURE_OPENAI_API_KEY=your-key
143
+ export CLOUD_SDK_AZURE__AZURE_OPENAI_ENDPOINT=your-endpoint
144
+ export CLOUD_SDK_AZURE__AZURE_STORAGE_CONNECTION_STRING=your-connection-string
145
+
146
+ # AWS Configuration
147
+ export CLOUD_SDK_CLOUD_PROVIDER=aws
148
+ export CLOUD_SDK_AWS__AWS_ACCESS_KEY_ID=your-key-id
149
+ export CLOUD_SDK_AWS__AWS_SECRET_ACCESS_KEY=your-secret-key
150
+ export CLOUD_SDK_AWS__AWS_REGION=us-east-1
151
+ ```
152
+
153
+ ### Configuration Dictionary
154
+
155
+ ```python
156
+ from agentic_composer_sdk import CloudProvider
157
+
158
+ # Azure configuration
159
+ azure_config = {
160
+ "cloud_provider": "azure",
161
+ "azure_storage_connection_string": "...",
162
+ "azure_storage_container_name": "my-container",
163
+ "azure_openai_api_key": "...",
164
+ "azure_openai_endpoint": "...",
165
+ "azure_cognitive_services_endpoint": "...",
166
+ "azure_cognitive_services_key": "...",
167
+ "azure_search_service_name": "...",
168
+ "azure_search_admin_key": "..."
169
+ }
170
+
171
+ # AWS configuration
172
+ aws_config = {
173
+ "cloud_provider": "aws",
174
+ "aws_access_key_id": "...",
175
+ "aws_secret_access_key": "...",
176
+ "aws_region": "us-east-1",
177
+ "aws_s3_bucket_name": "my-bucket",
178
+ "aws_opensearch_endpoint": "..."
179
+ }
180
+ ```
181
+
182
+ ## Service Examples
183
+
184
+ ### Storage Services
185
+
186
+ ```python
187
+ # Upload and download files
188
+ storage = cloud.get_storage_service()
189
+
190
+ # Upload
191
+ url = await storage.upload_file("path/to/file.txt", file_data)
192
+
193
+ # Download
194
+ data = await storage.download_file("path/to/file.txt")
195
+
196
+ # Get presigned URL
197
+ signed_url = await storage.get_file_url("path/to/file.txt")
198
+
199
+ # List files
200
+ files = await storage.list_files("path/prefix/")
201
+ ```
202
+
203
+ ### Database Services
204
+
205
+ ```python
206
+ # NoSQL operations
207
+ db = cloud.get_db_nosql_service()
208
+
209
+ # Store document
210
+ await db.put_item("table_name", {
211
+ "id": "doc_1",
212
+ "title": "My Document",
213
+ "content": "Document content..."
214
+ })
215
+
216
+ # Retrieve document
217
+ doc = await db.get_item("table_name", {"id": "doc_1"})
218
+
219
+ # Query documents
220
+ results = await db.query("table_name", {
221
+ "query": "SELECT * FROM c WHERE c.title = @title",
222
+ "parameters": [{"name": "@title", "value": "My Document"}]
223
+ })
224
+ ```
225
+
226
+ ### AI Services
227
+
228
+ ```python
229
+ # Text Analysis
230
+ text_analyzer = cloud.get_text_analysis_service()
231
+
232
+ sentiment = await text_analyzer.analyze_sentiment("I love this product!")
233
+ entities = await text_analyzer.recognize_entities("John works at Microsoft")
234
+ key_phrases = await text_analyzer.extract_key_phrases("Cloud computing benefits")
235
+
236
+ # Chat Completion
237
+ chat = cloud.get_chat_service()
238
+
239
+ messages = [
240
+ {"role": "system", "content": "You are a helpful assistant"},
241
+ {"role": "user", "content": "Explain machine learning"}
242
+ ]
243
+ response = await chat.chat_completion(messages, temperature=0.7)
244
+
245
+ # Streaming chat
246
+ async for chunk in chat.stream_chat_completion(messages):
247
+ print(chunk['choices'][0]['delta']['content'], end='')
248
+
249
+ # Embeddings
250
+ embedding_service = cloud.get_embedding_service()
251
+
252
+ embeddings = await embedding_service.create_embeddings([
253
+ "First document text",
254
+ "Second document text"
255
+ ])
256
+
257
+ # Search similar embeddings
258
+ similar = await embedding_service.similarity_search(
259
+ query_embedding, all_embeddings, top_k=5
260
+ )
261
+ ```
262
+
263
+ ### Search Services
264
+
265
+ ```python
266
+ search = cloud.get_search_service()
267
+
268
+ # Index document
269
+ await search.index_document("my_index", "doc_1", {
270
+ "id": "doc_1",
271
+ "title": "Document Title",
272
+ "content": "Document content...",
273
+ "vector_field": embedding_vector
274
+ })
275
+
276
+ # Text search
277
+ results = await search.search_documents("my_index", "search query")
278
+
279
+ # Vector search
280
+ vector_results = await search.vector_search("my_index", query_vector)
281
+ ```
282
+
283
+ ## Microservice Integration
284
+
285
+ Here's how to integrate the SDK into a microservice:
286
+
287
+ ```python
288
+ from fastapi import FastAPI
289
+ from agentic_composer_sdk import CloudProvider
290
+
291
+ app = FastAPI()
292
+
293
+ # Initialize cloud provider
294
+ cloud = CloudProvider(provider_type="azure", config=config)
295
+
296
+ @app.post("/process-document")
297
+ async def process_document(text: str):
298
+ # Analyze sentiment
299
+ sentiment = await cloud.analyze_text_sentiment(text)
300
+
301
+ # Create embeddings
302
+ embeddings = await cloud.create_text_embeddings(text)
303
+
304
+ # Store in database
305
+ doc_data = {
306
+ "text": text,
307
+ "sentiment": sentiment,
308
+ "embedding": embeddings[0]
309
+ }
310
+
311
+ db = cloud.get_db_nosql_service()
312
+ await db.put_item("documents", doc_data)
313
+
314
+ return {"status": "processed", "sentiment": sentiment}
315
+
316
+ @app.get("/search")
317
+ async def search_documents(query: str):
318
+ # Create query embedding
319
+ query_embedding = await cloud.create_text_embeddings(query)
320
+
321
+ # Vector search
322
+ search_service = cloud.get_search_service()
323
+ results = await search_service.vector_search(
324
+ "documents", query_embedding[0], top_k=10
325
+ )
326
+
327
+ return {"results": results}
328
+ ```
329
+
330
+ ## Provider-Specific Features
331
+
332
+ ### Azure-Specific
333
+
334
+ ```python
335
+ # Use specific Azure Cosmos DB API
336
+ cosmos_nosql = CosmosDBService.create(config, api_type="nosql")
337
+ cosmos_table = CosmosDBService.create(config, api_type="table")
338
+
339
+ # Azure OpenAI with specific deployment
340
+ chat_response = await azure_chat.chat_completion(
341
+ messages,
342
+ model="gpt-35-turbo-16k", # Your deployment name
343
+ temperature=0.7
344
+ )
345
+ ```
346
+
347
+ ### AWS-Specific
348
+
349
+ ```python
350
+ # Use DynamoDB with specific query parameters
351
+ results = await dynamodb.query("table", {
352
+ "KeyConditionExpression": Key("pk").eq("value"),
353
+ "FilterExpression": Attr("status").eq("active")
354
+ })
355
+
356
+ # Use Bedrock with specific model
357
+ chat_response = await bedrock_chat.chat_completion(
358
+ messages,
359
+ model="anthropic.claude-3-sonnet-20240229-v1:0"
360
+ )
361
+ ```
362
+
363
+ ## Testing
364
+
365
+ ```bash
366
+ # Install test dependencies
367
+ pip install -e ".[test]"
368
+
369
+ # Run tests
370
+ pytest tests/
371
+
372
+ # Run with coverage
373
+ pytest --cov=src tests/
374
+ ```
375
+
376
+ ## Development
377
+
378
+ ```bash
379
+ # Install development dependencies
380
+ pip install -e ".[dev]"
381
+
382
+ # Format code
383
+ black src/ tests/
384
+ isort src/ tests/
385
+
386
+ # Type checking
387
+ mypy src/
388
+
389
+ # Linting
390
+ flake8 src/ tests/
391
+ ```
392
+
393
+ ## Contributing
394
+
395
+ 1. Fork the repository
396
+ 2. Create a feature branch
397
+ 3. Make your changes
398
+ 4. Add tests
399
+ 5. Run the test suite
400
+ 6. Submit a pull request
401
+
402
+ ## License
403
+
404
+ This project is licensed under the MIT License - see the LICENSE file for details.
405
+
406
+ ## Support
407
+
408
+ For support and questions:
409
+ - Create an issue on GitHub
410
+ - Check the examples directory for more usage patterns
411
+ - Review the API documentation
412
+
413
+ ## Roadmap
414
+
415
+ - [ ] Google Cloud Platform support
416
+ - [ ] Additional AI services (speech, vision)
417
+ - [ ] Caching layer
418
+ - [ ] Monitoring and observability
419
+ - [ ] Rate limiting and retry mechanisms
420
+ - [ ] Configuration validation
421
+ - [ ] More database providers (MongoDB, Redis)
@@ -0,0 +1,4 @@
1
+ cloudkit-0.1.0.dist-info/METADATA,sha256=rNUSaCQf8ffqqK76-FG_ctVz72rA0dA7gof_Cw7Fs9g,11113
2
+ cloudkit-0.1.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
3
+ cloudkit-0.1.0.dist-info/licenses/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ cloudkit-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.28.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
File without changes