Skip to main content

Shared services for TinyAI microservices platform

Project description

TinySDK

Shared service clients for the TinyAI microservices platform — MongoDB, MinIO, RabbitMQ, and structured logging with a consistent interface.

Installation

pip install tinysdk

Quick Start

from tinysdk import TinyDBService, TinyStorageHandler, TinyMessageService, TinyMessageServiceSync, TinyLogger

# MongoDB
db = TinyDBService()
db.create({"collection": "users", "document": {"name": "John"}})

# MinIO / S3
storage = TinyStorageHandler()
storage.upload_file("my-bucket", "file.txt", buffer, size)

# RabbitMQ (async)
svc = TinyMessageService([("my-queue", handler)])
svc.publish("my-queue", {"task": "run"})
svc.run()

# RabbitMQ (sync)
svc = TinyMessageServiceSync()
svc.publish("my-queue", {"task": "run"})

# Logger
logger = TinyLogger()
logger.log("something happened", level="INFO", context={"key": "value"})
logger.start_heartbeat()  # emits periodic HEARTBEAT events

doc_logger = logger.for_document("doc-id-123")
doc_logger.log("processing started")

Configuration

All clients read credentials from environment variables.

Service Variable Example
MongoDB DB_LINK mongodb://mongo:27017
MongoDB DB_NAME tinyDatabase
MinIO MINIO_ENDPOINT minio:9000
MinIO MINIO_ACCESSKEY minioadmin
MinIO MINIO_SECRETKEY minioadmin
RabbitMQ RABBITMQ_HOST rabbitmq
RabbitMQ RABBITMQ_PORT 5672
RabbitMQ RABBITMQ_USER guest
RabbitMQ RABBITMQ_PASS guest
Logger SERVICE_NAME my-service
Logger CLUSTER prod
Logger NAMESPACE default
Logger LOG_LEVEL INFO
Logger HEARTBEAT_INTERVAL 30

Credentials can also be passed directly as constructor arguments.

License

MIT

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

tinysdk-0.2.2.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

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

tinysdk-0.2.2-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file tinysdk-0.2.2.tar.gz.

File metadata

  • Download URL: tinysdk-0.2.2.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tinysdk-0.2.2.tar.gz
Algorithm Hash digest
SHA256 a2f28bd265df319042d3b9e795fa21c543fa2e0d96670e471308b46b7c9be839
MD5 3cf86fa4755f64b44657dd2896c84ca8
BLAKE2b-256 d90035f4b659ed7cbe8c561515827cf6979978c015b64eda1c9e368a6eefb159

See more details on using hashes here.

Provenance

The following attestation bundles were made for tinysdk-0.2.2.tar.gz:

Publisher: publish.yml on synapzegmbh/TinySDK

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tinysdk-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: tinysdk-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tinysdk-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4650a14507d74d6daf0ad9252c8c404e9655bdabdf569f26174732145b7d61bc
MD5 0e29fb9ccc658f5dbb30527be204234d
BLAKE2b-256 277552b884d99de875bf98fb92ecd37c4875d85705eaea3f04b00fe0c3acae42

See more details on using hashes here.

Provenance

The following attestation bundles were made for tinysdk-0.2.2-py3-none-any.whl:

Publisher: publish.yml on synapzegmbh/TinySDK

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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