Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

petbox-client (Python)

Sync, zero-dependency Python SDK for PetBox config. Fetches resolved config from /v1/conf with ETag-aware background polling. Supports all four response templates (flat, dotnet, envvar, envvar-deep).

This is the Python analog of the TypeScript SDK @stdray-npm/petbox-client. Data + Log surfaces land later, matching the TS roadmap.

Install

pip install petbox-client

Usage

import os
from petbox_client import PetBoxConfigClient, PetBoxConfigClientOptions

client = PetBoxConfigClient(PetBoxConfigClientOptions(
    endpoint="https://petbox.3po.su",
    api_key=os.environ["PETBOX_API_KEY"],
    tags={"env": "prod", "project": "kpvotes"},
))

# Initial fetch + start background polling.
config = client.start()
print(config.get("db.host"))
print(config.get_number("db.port"))
print(config.get_bool("features.cache"))

# React to live config changes.
client.on("change", lambda cfg: print("config updated", cfg.data))
client.on("error", lambda err: print("poll failed", err))

# Stop polling when done (or use the client as a context manager).
client.dispose()

One-shot fetch without keeping an instance:

from petbox_client import fetch_config, PetBoxConfigClientOptions

config = fetch_config(PetBoxConfigClientOptions(
    endpoint="https://petbox.3po.su",
    api_key="...",
    tags={"env": "prod"},
    refresh_interval=0,  # disable polling
))

API

  • PetBoxConfigClient(options) — fetch(), start(), stop(), dispose(), on(event, listener) / off(...) for "change" and "error", current property.
  • ResolvedConfig — get(path), get_number(path), get_bool(path), get_json(path), to_env(), data, etag. For the flat template get("db.host") traverses the nested tree; for the other templates it does a direct key lookup.
  • fetch_config(options) — one-shot convenience.
  • PetBoxConfigError — structured API error with status and body.

License

MIT

Metadata

Release files for petbox-client 0.1.0.dev460

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for petbox-client 0.1.0.dev460
File Size Uploaded Provenance Actions
petbox_client-0.1.0.dev460.tar.gz 39.5 kB Without provenance Details for petbox_client-0.1.0.dev460.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for petbox-client 0.1.0.dev460
File Interpreter ABI Platform Actions
petbox_client-0.1.0.dev460-py3-none-any.whl Python 3 none any Details for petbox_client-0.1.0.dev460-py3-none-any.whl

Total release size: 52.5 kB

Release files / petbox_client-0.1.0.dev460.tar.gz

Download URL petbox_client-0.1.0.dev460.tar.gz
Size 39.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3e1d6ee99c76d147a8324e9fffca84534cb889b5ec23073c7cde1e81372f4988
BLAKE2b-256 checksum
How to use checksums
7e1488d3ed5f58e8f107b3ce8d28cfb811e709e4b7448f15d8476bb867be1b09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / petbox_client-0.1.0.dev460-py3-none-any.whl

Download URL petbox_client-0.1.0.dev460-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
885984334f11e0235578cdfbf4eea5907542cce15e6a73bb5f347a6c65b78255
BLAKE2b-256 checksum
How to use checksums
ecbe793b9b3702eed71956cf23faf2c29e9089d465f243f8d250e76532ae6521
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for petbox-client 0.1.0.dev460

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page