Skip to main content

Python client SDK for the beachcomber (comb) shell-state daemon

Project description

beachcomber Python SDK

Python client for the beachcomber (comb) shell-state daemon.

Requirements

  • Python 3.9+
  • No external dependencies (stdlib only)
  • A running comb daemon

Installation

pip install beachcomber

Or with uv:

uv add beachcomber

Quick start

from beachcomber import Client

client = Client()

# Read a single field
result = client.get("git.branch", path="/path/to/repo")
if result.is_hit:
    print(result.data)    # "main"
    print(result.age_ms)  # 234
    print(result.stale)   # False

# Read a full provider (returns dict)
result = client.get("git", path="/path/to/repo")
if result.is_hit:
    print(result["branch"])  # "main"
    print(result["dirty"])   # False

# Force recomputation
client.poke("git", path="/path/to/repo")

# List available providers
providers = client.list()

# Daemon status
status = client.status()

Sessions

For multiple queries use a session to reuse a single connection:

with client.session() as session:
    session.set_context("/path/to/repo")
    branch = session.get("git.branch")
    dirty = session.get("git.dirty")
    hostname = session.get("hostname")

Custom socket path

client = Client(socket_path="/run/user/1000/beachcomber/sock")

Socket discovery

The SDK discovers the daemon socket at:

  1. $XDG_RUNTIME_DIR/beachcomber/sock
  2. $TMPDIR/beachcomber-<uid>/sock
  3. /tmp/beachcomber-<uid>/sock

Exceptions

Exception When raised
DaemonNotRunning Cannot connect to the socket
ServerError Daemon returns ok: false
ProtocolError Malformed JSON or I/O failure
CombError Base class for all SDK errors

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

libbeachcomber-0.2.0.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

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

libbeachcomber-0.2.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file libbeachcomber-0.2.0.tar.gz.

File metadata

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

File hashes

Hashes for libbeachcomber-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6f98a21d4fc9ff88907ac7b2d15aca7f7d7c665998b5e5bdfbbdaf009b875f84
MD5 44c82f1e0e8db8d722da4e259bf568af
BLAKE2b-256 8fc9e97c46f6695a30703911665ed7d330130d0ffa2db69ddd4308565a42f36b

See more details on using hashes here.

Provenance

The following attestation bundles were made for libbeachcomber-0.2.0.tar.gz:

Publisher: release.yml on NavistAu/beachcomber

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

File details

Details for the file libbeachcomber-0.2.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for libbeachcomber-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2ba00a5df854fc65a91a64a87ccb536d15058b10727f6bf122904b4957a195a8
MD5 8075330d61ac485659f431e2c92f50cf
BLAKE2b-256 ce4b5830946114024119013086fd9fa243028d8e8337e52dc65d147a7995894f

See more details on using hashes here.

Provenance

The following attestation bundles were made for libbeachcomber-0.2.0-py3-none-any.whl:

Publisher: release.yml on NavistAu/beachcomber

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