Skip to main content

Shared Python infrastructure library for isA platform

Project description

isA Common

Shared async Python client library for the isA platform.

Overview

isa-common provides async Python clients for interacting with isA Cloud infrastructure services. All clients use async with context managers and share a common base class (AsyncBaseClient).

Infrastructure Clients (require running services)

Client Service Default Port Protocol
AsyncRedisClient Redis 6379 gRPC proxy
AsyncPostgresClient PostgreSQL 5432 gRPC proxy
AsyncNeo4jClient Neo4j 7687 gRPC proxy
AsyncNATSClient NATS 4222 gRPC proxy
AsyncMQTTClient MQTT 1883 gRPC proxy
AsyncMinioClient MinIO 9000 gRPC proxy
AsyncQdrantClient Qdrant 6333 gRPC proxy
AsyncDuckDBClient DuckDB embedded native

Local-Mode Clients (no external services needed)

Drop-in alternatives for desktop/offline use. Same API surface, backed by local storage:

Local Client Replaces Backed By
AsyncSQLiteClient AsyncPostgresClient SQLite file
AsyncLocalStorageClient AsyncMinioClient Local filesystem
AsyncChromaClient AsyncQdrantClient ChromaDB (embedded)
AsyncMemoryClient AsyncRedisClient In-memory dict

When to use local clients: Use local-mode clients when running on desktop/ICP without cloud infrastructure, for development/testing without Docker, or when you need offline-capable storage.

Installation

pip install isa-common

Quick Start

from isa_common import AsyncRedisClient

async with AsyncRedisClient(host="localhost", port=6379, user_id="my-user") as client:
    health = await client.health_check()
    await client.set("key", "value")
    value = await client.get("key")

Using Local-Mode Clients

from isa_common import AsyncSQLiteClient, AsyncLocalStorageClient

# SQLite instead of PostgreSQL
async with AsyncSQLiteClient(database="app.db", user_id="my-user") as db:
    await db.query("SELECT * FROM users")

# Local filesystem instead of MinIO
async with AsyncLocalStorageClient(base_path="./storage", user_id="my-user") as storage:
    await storage.put_object("my-bucket", "file.txt", b"contents")

Development

Run tests (requires services or use local clients):

# Run individual service tests
python tests/redis/test_async_redis.py
python tests/duck/test_async_duckdb.py

# Run all tests via Makefile
make test

Contract Coverage

See tests/contract_coverage.md for the mapping between CDD contract IDs (BR/EC/ER) and test functions.

License

Copyright © 2024 isA Platform

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

isa_common-0.6.0.tar.gz (123.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

isa_common-0.6.0-py3-none-any.whl (136.7 kB view details)

Uploaded Python 3

File details

Details for the file isa_common-0.6.0.tar.gz.

File metadata

  • Download URL: isa_common-0.6.0.tar.gz
  • Upload date:
  • Size: 123.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for isa_common-0.6.0.tar.gz
Algorithm Hash digest
SHA256 a347deb9fb697924723546c6f5408fd6d5e6fc25dafe8cc54c7ca155df88cd5f
MD5 b388cf36feb5ebccb60a905feb1af503
BLAKE2b-256 bce2cae4b1cac26b7bff3ece2614e230c59ef5b6ebaa7387b3dfda5a4cec8998

See more details on using hashes here.

File details

Details for the file isa_common-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: isa_common-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 136.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for isa_common-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 705981c37414a8bb46edb44ac876853eb94780ee17571e8c37839d7400a8339c
MD5 ed449cd573c3b2ecd2ffebed216d853d
BLAKE2b-256 33b96d45c0962bd39db1461b9c2cc242eb6035a08356d23fc5505482b92f8abf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page