Skip to main content

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

spendwall-0.1.1.tar.gz (32.3 kB view details)

Uploaded Source

Built Distributions

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

spendwall-0.1.1-py3-none-manylinux_2_35_x86_64.whl (37.3 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ x86-64

spendwall-0.1.1-py3-none-manylinux_2_35_aarch64.whl (33.6 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ ARM64

spendwall-0.1.1-py3-none-macosx_11_0_arm64.whl (9.6 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

spendwall-0.1.1-py3-none-macosx_10_12_x86_64.whl (10.1 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

spendwall-0.1.1-py3-none-any.whl (23.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: spendwall-0.1.1.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

Hashes for spendwall-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b7d023fe2b8a8ba0f2a6415864308ec3ec2176b743a1dc4f86d199672f36fdfd
MD5 02a5a4bc85c083c0db0c4b7997cf737e
BLAKE2b-256 d3309a68d101e52ec4a927979a2de05fef7eee2f1fc3bd16653a43fc15d8df7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for spendwall-0.1.1.tar.gz:

Publisher: release.yml on catancs/spendwall

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

File details

Details for the file spendwall-0.1.1-py3-none-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for spendwall-0.1.1-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 25585987d8951be2f60602c294c008065c689aa789e0ab6d6d18297c820bba27
MD5 2d182a607d726ef59e21a38ba0756e8b
BLAKE2b-256 8ca5f0969c6942abe68a876d349aa7479ccb027a8a7c03d90dcc7dfd2a382116

See more details on using hashes here.

Provenance

The following attestation bundles were made for spendwall-0.1.1-py3-none-manylinux_2_35_x86_64.whl:

Publisher: release.yml on catancs/spendwall

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

File details

Details for the file spendwall-0.1.1-py3-none-manylinux_2_35_aarch64.whl.

File metadata

File hashes

Hashes for spendwall-0.1.1-py3-none-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 16f7ea01c304e9987f51bcb014791c456877127803ef03ed45424967e5a5cf84
MD5 fe2d5bb68ffc62dbf3cb8f820a8e7525
BLAKE2b-256 1291e8d0cd09ca574d15ecd2746ad7e322174cbc3b29c3fd02fa7f91f81d8502

See more details on using hashes here.

Provenance

The following attestation bundles were made for spendwall-0.1.1-py3-none-manylinux_2_35_aarch64.whl:

Publisher: release.yml on catancs/spendwall

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

File details

Details for the file spendwall-0.1.1-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spendwall-0.1.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 612c944a8cfd47ff5d2b05d5afb8819d56c7014cb6b544bac6c921ca479c4714
MD5 39274128860e3e73c8942b38620580f5
BLAKE2b-256 cfcca829b2d31d5e1e72807e360209ce0aa502c6acbf0c354ef5f0ebab912ca0

See more details on using hashes here.

Provenance

The following attestation bundles were made for spendwall-0.1.1-py3-none-macosx_11_0_arm64.whl:

Publisher: release.yml on catancs/spendwall

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

File details

Details for the file spendwall-0.1.1-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for spendwall-0.1.1-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ad4320c47ce72fb54482ce360a5232d82659830840e736488874802f01761752
MD5 84ecf26f3767eaaff9b8e3eaa129f5dd
BLAKE2b-256 299a4110806eb5952cb901ea0b6bf9633483e0ce51ab477fa514df3cb97e0a7a

See more details on using hashes here.

Provenance

The following attestation bundles were made for spendwall-0.1.1-py3-none-macosx_10_12_x86_64.whl:

Publisher: release.yml on catancs/spendwall

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

File details

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

File metadata

  • Download URL: spendwall-0.1.1-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

Hashes for spendwall-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b79ee9c0fc5973d8392cd42d1b37ec58b51c185afad11233e56cd496e60ed5b0
MD5 9b5f69b38af9848307ac635d96ba3a1e
BLAKE2b-256 70e94996ed3f580836b671f787301101cf933d8b8fa0cb20b727929c502e8593

See more details on using hashes here.

Provenance

The following attestation bundles were made for spendwall-0.1.1-py3-none-any.whl:

Publisher: release.yml on catancs/spendwall

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