Spendwall SDK — local-first agent spend firewall
Project description
spendwall (Python)
Quick start
from spendwall import SpendwallClient
# Zero config: socket and token are auto-discovered from ~/.spendwall
# (override with SPENDWALL_DIR / SPENDWALL_SOCKET / SPENDWALL_TOKEN).
client = SpendwallClient()
Daemon lifecycle
Zero-install by default: the client lazily auto-spawns the daemon on the first call if none is running, and the daemon self-initializes its data dir.
from spendwall import ensure_daemon, SpendwallClient
# Just use it — the daemon is spawned + self-initialized on the first call.
client = SpendwallClient()
# Or manage it explicitly: reuse a healthy daemon, or spawn one (binary via
# SPENDWALL_DAEMON_BIN, the bundled wheel, or PATH).
ensure_daemon()
Opt out of auto-spawn with SPENDWALL_AUTOSPAWN=0 (or SpendwallClient(auto_spawn=False)).
With it disabled, a down daemon fails open in observe/advisory modes and
raises DaemonNotRunningError in enforce mode.
~/.spendwall/auth.toml is machine-managed — the daemon self-generates its
bearer token on first run; don't edit it.
Compatibility window
The SDK checks the daemon's version from /v1/about on first use and refuses a
daemon whose SemVer major is more than 2 away from the SDK's (in either
direction) — raising SpendwallVersionMismatch, which fail-open clients
(observe/advisory) swallow and enforce surfaces. If the daemon advertises a
deprecation notice, the SDK emits a warnings.warn. (Pre-1.0 every version is
major 0, so the window is always satisfied today.)
Provider wrappers
import openai
import spendwall.openai as sw
client = openai.OpenAI(api_key="sk-...")
client = sw.wrap(client, mode="enforce")
# Now every client.chat.completions.create(...) is observed by spendwalld.
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
Built Distributions
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 spendwall-0.1.0.tar.gz.
File metadata
- Download URL: spendwall-0.1.0.tar.gz
- Upload date:
- Size: 32.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61009daa2a7c291e407e9c5c21fd963bd5345d20c6530c46adc94aa2419cd75a
|
|
| MD5 |
e59ce4393bd3e4e94dc9d64ec6f30236
|
|
| BLAKE2b-256 |
f08525e0a67d620929d424ba94a291a3dd894d08d27d04edde525bd3e4b6675a
|
Provenance
The following attestation bundles were made for spendwall-0.1.0.tar.gz:
Publisher:
release.yml on catancs/spendwall
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spendwall-0.1.0.tar.gz -
Subject digest:
61009daa2a7c291e407e9c5c21fd963bd5345d20c6530c46adc94aa2419cd75a - Sigstore transparency entry: 1899036089
- Sigstore integration time:
-
Permalink:
catancs/spendwall@84ce91afe7de7b3d2c61e4eae9390198cc0749a0 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/catancs
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@84ce91afe7de7b3d2c61e4eae9390198cc0749a0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file spendwall-0.1.0-py3-none-manylinux_2_35_x86_64.whl.
File metadata
- Download URL: spendwall-0.1.0-py3-none-manylinux_2_35_x86_64.whl
- Upload date:
- Size: 37.3 MB
- Tags: Python 3, manylinux: glibc 2.35+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15fd9542b83a5b384894f827b5705e49ff249c9abc7927d4b4e66e27b62fc556
|
|
| MD5 |
3d9fdcd8b0fc87516db1923eb320ed95
|
|
| BLAKE2b-256 |
58dff2cdeb5accde3fa70c97f761f3d68bdb7e41a12fa8eb2bb9cc3ffee2a4fe
|
Provenance
The following attestation bundles were made for spendwall-0.1.0-py3-none-manylinux_2_35_x86_64.whl:
Publisher:
release.yml on catancs/spendwall
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spendwall-0.1.0-py3-none-manylinux_2_35_x86_64.whl -
Subject digest:
15fd9542b83a5b384894f827b5705e49ff249c9abc7927d4b4e66e27b62fc556 - Sigstore transparency entry: 1899101014
- Sigstore integration time:
-
Permalink:
catancs/spendwall@84ce91afe7de7b3d2c61e4eae9390198cc0749a0 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/catancs
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@84ce91afe7de7b3d2c61e4eae9390198cc0749a0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file spendwall-0.1.0-py3-none-any.whl.
File metadata
- Download URL: spendwall-0.1.0-py3-none-any.whl
- Upload date:
- Size: 23.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83fc88fa5a562a254bb815f73a9606f27857093734df01a54c4c28f8e0cee758
|
|
| MD5 |
17b48fa41aa87ef7ea639d19a5ea0446
|
|
| BLAKE2b-256 |
5bcf4bc862f95fcacd552c7ce7cbe7a46f5bc395264caee5155b28665a69e05d
|
Provenance
The following attestation bundles were made for spendwall-0.1.0-py3-none-any.whl:
Publisher:
release.yml on catancs/spendwall
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spendwall-0.1.0-py3-none-any.whl -
Subject digest:
83fc88fa5a562a254bb815f73a9606f27857093734df01a54c4c28f8e0cee758 - Sigstore transparency entry: 1899036273
- Sigstore integration time:
-
Permalink:
catancs/spendwall@84ce91afe7de7b3d2c61e4eae9390198cc0749a0 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/catancs
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@84ce91afe7de7b3d2c61e4eae9390198cc0749a0 -
Trigger Event:
push
-
Statement type: