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
combdaemon
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:
$XDG_RUNTIME_DIR/beachcomber/sock$TMPDIR/beachcomber-<uid>/sock/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.1.0.tar.gz
(12.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file libbeachcomber-0.1.0.tar.gz.
File metadata
- Download URL: libbeachcomber-0.1.0.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6b9d5cd95ec603b31f1d7c9d4dcaad5062e6d00e25cb16b11be72e878e3405e
|
|
| MD5 |
92524c0b61a743b99d26a2b81818fcf8
|
|
| BLAKE2b-256 |
1e21ab0542af5c1b6aab947289df65f43a5d48ad5d65eefe8b6f6a9d3abe88cd
|
File details
Details for the file libbeachcomber-0.1.0-py3-none-any.whl.
File metadata
- Download URL: libbeachcomber-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fba24aa75c0597ee6bb58c5bf058a4ba3204e3df275259589d4da942a701742e
|
|
| MD5 |
42dafa12ebdc4d9cb8882743eb74c1f3
|
|
| BLAKE2b-256 |
2bb84e5e9637237b7eeacbc4df07e7931b688aea69950b826f798da44e99c74e
|