Skip to main content

Python SDK for interacting with Keyhole-compatible runtimes

Project description

keyhole-sdk

Python SDK for interacting with Keyhole-compatible runtimes.

Install

pip install keyhole-sdk

Quickstart

from keyhole_sdk import KeyholeClient

client = KeyholeClient(base_url="http://localhost:8080")

# Health check
print(client.health())

# Runtime identity and capabilities
print(client.identity())

# Current runtime state
print(client.state())

# Submit a realization request
receipt = client.realize(
    candidate_digest="sha256:abc123",
    payload={},
)
print(receipt)

# Replay the same digest safely
replay = client.realize(
    candidate_digest="sha256:abc123",
    payload={},
)
print(replay)

client.close()

API

Method Description
health() GET /healthz — runtime liveness
identity() GET /identity — runtime identity and capabilities
state() GET /state — current runtime-local state
realize(candidate_digest, payload) POST /realize — bounded realization request
close() Close the underlying HTTP session

Models

Pydantic models are available in keyhole_sdk.models:

  • RuntimeIdentity
  • RuntimeState
  • RealizationRequest
  • RealizationReceipt

Configuration

client = KeyholeClient(
    base_url="http://localhost:8080",
    timeout=10.0,  # default
)

You can also pass a custom requests.Session for advanced use cases.

Compatibility

RuntimeBridgeClient is available as a backward-compatible alias for KeyholeClient.

License

Apache 2.0 — see LICENSE.

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

keyhole_sdk-0.1.1.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

keyhole_sdk-0.1.1-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file keyhole_sdk-0.1.1.tar.gz.

File metadata

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

File hashes

Hashes for keyhole_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b850fa9cbd093a8ffc1663ca0e8fc807320226605d12e61d6c44d254c9271237
MD5 b619af0430811937f38e3aa62ef4c7d2
BLAKE2b-256 bf9dd023d429c1111dc4a5d1f794ac1212743dd57c8ed477fa74f3a09b4ed939

See more details on using hashes here.

File details

Details for the file keyhole_sdk-0.1.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for keyhole_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5f72f360d05c42b0686d827cbf8e9d24c3ef4b7e33f62d76fa85057d5be44cb3
MD5 40fce3cae012e6a3dae0b2f2e6580d47
BLAKE2b-256 dffa4397785e306f25d05515cbb0c756661411cf8b1a17ffd587b322363c9552

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