Shared Python infrastructure library for isA platform
Project description
isA Common
Shared Python infrastructure library for the isA platform.
Overview
This package provides common infrastructure components used across all isA Python services:
- gRPC Clients: NATS, MinIO, MQTT, DuckDB, Supabase, etc.
- Event Framework: Generic event-driven architecture base classes
- Proto Files: Generated gRPC proto files
Installation
Development Install (Recommended)
pip install -e /Users/xenodennis/Documents/Fun/isA_Cloud/isA_common
From Source
cd /Users/xenodennis/Documents/Fun/isA_Cloud/isA_common
pip install .
Usage
gRPC Clients
from grpc_clients import NATSClient, MinIOClient, get_client
# Option 1: Direct instantiation
nats = NATSClient(host='localhost', port=50056)
# Option 2: Factory pattern
nats = get_client('nats', user_id='my_service')
Event Framework
from grpc_clients.events import BaseEvent, BaseEventPublisher
# Define your event
class MyEvent(BaseEvent):
event_type: str = "my.event"
data: str
# Define your publisher
class MyEventPublisher(BaseEventPublisher):
def service_name(self) -> str:
return "my_service"
async def publish_my_event(self, data: str) -> bool:
event = MyEvent(event_type="my.event", data=data)
return await self.publish_event(event, subject="my.event")
Projects Using isA_common
- isA_user - Microservices platform (17 services)
- isA_Model - AI model inference service
- isA_Agent - AI agent service
- isA_MCP - Model Control Protocol service
Components
gRPC Clients (grpc_clients/)
NATSClient- NATS message bus client (port 50056)MinIOClient- Object storage client (port 50051)MQTTClient- MQTT broker client (port 50053)DuckDBClient- Analytics database client (port 50052)SupabaseClient- Supabase client (port 50057)
Event Framework (grpc_clients/events/)
BaseEvent- Base event model with metadataEventMetadata- Standard event metadataBaseEventPublisher- Base publisher class (abstract)BaseEventSubscriber- Base subscriber class with idempotencyEventHandler- Event handler interface (abstract)IdempotencyChecker- Duplicate preventionRetryPolicy- Retry configuration
Development
Generating Proto Files
Proto files are generated from the parent isA_Cloud project:
cd /Users/xenodennis/Documents/Fun/isA_Cloud
./scripts/generate-grpc.sh
This script generates:
- Go proto files →
api/proto/*.pb.go - Python proto files →
isA_common/grpc_clients/proto/*.py
Running Tests
cd /Users/xenodennis/Documents/Fun/isA_Cloud/isA_common
pytest tests/
Package Structure
isA_Cloud/
├── isA_common/ # Python package
│ ├── grpc_clients/
│ │ ├── __init__.py
│ │ ├── base_client.py
│ │ ├── nats_client.py
│ │ ├── minio_client.py
│ │ ├── mqtt_client.py
│ │ ├── duckdb_client.py
│ │ ├── supabase_client.py
│ │ ├── events/
│ │ │ ├── __init__.py
│ │ │ ├── base_event_models.py
│ │ │ ├── base_event_publisher.py
│ │ │ └── base_event_subscriber.py
│ │ └── proto/
│ │ ├── __init__.py
│ │ ├── common_pb2.py
│ │ ├── nats_service_pb2.py
│ │ └── ...
│ ├── setup.py
│ ├── pyproject.toml
│ ├── README.md
│ └── requirements.txt
├── scripts/
│ └── generate-grpc.sh # Generates to isA_common/
└── api/proto/ # Proto definitions
Version
Current version: 0.1.0
License
Proprietary - isA Platform
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file isa_common-0.1.0.tar.gz.
File metadata
- Download URL: isa_common-0.1.0.tar.gz
- Upload date:
- Size: 84.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93bc5fe7f9824c0846946086f26839a388449fadda25913ef800114baa9b2cf6
|
|
| MD5 |
3c2b1bb73735505668e09f143606b7aa
|
|
| BLAKE2b-256 |
6891a6784ba17860764c6f559f511ddebeccbbdd39850c436984a9b2032af44c
|
File details
Details for the file isa_common-0.1.0-py3-none-any.whl.
File metadata
- Download URL: isa_common-0.1.0-py3-none-any.whl
- Upload date:
- Size: 93.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8620d0ce5699b233b27055f482de418a937a3b9be4055fbff34dfb1fb497cda
|
|
| MD5 |
04264a8b057dd4feae64685267b6f349
|
|
| BLAKE2b-256 |
0c0ad626dd4f6a68c292410546260bebc2d6e091914de316c125fcbd64fd5e7b
|