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.refresh("git", path="/path/to/repo")

# 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. $BEACHCOMBER_SOCKET (if set and non-empty)
  2. $XDG_RUNTIME_DIR/beachcomber/sock (if XDG_RUNTIME_DIR is set)
  3. /tmp/beachcomber-<uid>/sock

This mirrors the daemon's bind path; $TMPDIR is not consulted.

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.6.1.tar.gz (22.4 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.6.1-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for libbeachcomber-0.6.1.tar.gz
Algorithm Hash digest
SHA256 36f8dccbc03da53530691c62b0f3c2662cecd853b4eec3036584fdfe99839218
MD5 2b88d7628d1bece1a11687b6882abf85
BLAKE2b-256 191dd462165842204ced71c095b8d5c0e21b031af48c8ed6944dd9ebd1aa8128

See more details on using hashes here.

Provenance

The following attestation bundles were made for libbeachcomber-0.6.1.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.6.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for libbeachcomber-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a787c4771573ff5149916553add2b1774b7b2d616a459321f889b860e4e79d13
MD5 a87829c4f970964820b6d43e96fdcc0c
BLAKE2b-256 16b1173deff7fa1716ec99f9ae94a998af09550988b72b78cd4448cbbe4559d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for libbeachcomber-0.6.1-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