Skip to main content

TinySDK

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

Installation

pip install tinysdk

Quick Start

from tinysdk import TinyDBService, TinyStorageService, TinyWorkerService, TinyWorkflowService, get_temporal_client, TinyLogger

# MongoDB
db = TinyDBService()
doc_id = db.create("users", {"name": "John", "email": "john@example.com"})
users  = db.read("users", filter={"name": "John"})
count  = db.update("users", {"name": "John"}, {"$set": {"active": True}})
count  = db.delete("users", {"name": "John"})
exists = db.exists("users", {"email": "john@example.com"})
ids    = db.create_multiple("users", [{"name": "Alice"}, {"name": "Bob"}])
db.close()

# MinIO / S3
storage = TinyStorageService()
storage.upload_file("my-bucket", "file.txt", buffer)          # file_size auto-detected
storage.upload_file("my-bucket", "file.txt", buffer, 1024)    # or pass explicitly
file_buffer, name = storage.download_file("my-bucket", "file.txt")
storage.upload_folder("my-bucket", "/local/folder")
storage.download_folder("my-bucket", "folder-name", "/local/dest")
storage.close()

# Temporal (activity/workflow worker for a task queue)
from temporalio import activity

@activity.defn
async def my_activity(payload: dict) -> None:
    ...

worker = TinyWorkerService()   # logger optional; defaults to TinyLogger()
await worker.start(task_queue="my-queue", activities=[my_activity])  # or workflows=[...]

# Or just a connected client
client = await get_temporal_client()

# Temporal (read-only workflow queries) — async, call from an async function
workflow_svc = TinyWorkflowService()
status  = await workflow_svc.get_status("order-123")           # status, timings, task queue
history = await workflow_svc.get_history_summary("order-123")  # condensed event history
summary = await workflow_svc.get_summary("order-123")          # status + history in one call

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

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
Temporal TEMPORAL_ADDRESS temporal-server:7233
Temporal TEMPORAL_NAMESPACE default
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

Metadata

Release files for tinysdk 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tinysdk 0.7.0
File Size Uploaded
tinysdk-0.7.0.tar.gz 60.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tinysdk 0.7.0
File Interpreter ABI Platform
tinysdk-0.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 105.9 kB

Release files / tinysdk-0.7.0.tar.gz

Download URL tinysdk-0.7.0.tar.gz
Size 60.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4ab8c8cfe5819da7ac79431aa31adc4a897aa05a533e08bbcfc95ea9a7e1543e
BLAKE2b-256 checksum
How to use checksums
146593274fa05b91b197f6f788befff23702a8f3fad48bfec2a3cbf6495bddf5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.

Transparency log

Release files / tinysdk-0.7.0-py3-none-any.whl

Download URL tinysdk-0.7.0-py3-none-any.whl
Size 45.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab4f784fb66606f56a7666ac32b7d68e6d454b937604afe13ecaab5f4953cde6
BLAKE2b-256 checksum
How to use checksums
3e5312584e7ffa395115570bce1c9e894a664e93ce18e1570892ed188c5d769f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.

Transparency log

Release history Release notifications | RSS feed

0.11.0

2 release files

0.9.10

2 release files

0.9.9

2 release files

0.9.8

2 release files

0.9.6

2 release files

0.9.5

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.0

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.2

2 release files

0.7.1

2 release files

This release

0.7.0 This release

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.8

2 release files

0.5.7

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.9

2 release files

0.4.8

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page