Skip to main content

Ranbval Runtime Blind Decryption Python SDK (no vendor SDK dependencies)

Project description

Ranbval Python SDK

Decrypt Ranbval vault tokens in memory, optional telemetry to your password-manager, repo allowlist checks, and layered .ranbval* config.

This package does not depend on OpenAI, Stripe, Anthropic, Mistral, or Supabase. You pip install whichever vendor you use, then pass that SDK’s class to secure_client or build_secure_client.

Install

pip install ranbval-sdk

Then in your project (examples):

pip install openai
# or: pip install anthropic stripe …

Config: layered .ranbval*

Call load_ranbval() yourself (not on import).

from ranbval_sdk import load_ranbval

load_ranbval()

Merge order (later overrides earlier): .ranbval.ranbval.{mode}.ranbval.local.ranbval.{mode}.local. Mode from load_ranbval(mode="production") or RANBVAL_ENV / ENVIRONMENT / ENV (default development).

See .ranbval.example. Add .ranbval.local to .gitignore.

Quick start — any SDK (OpenAI, Stripe, …)

import openai
from ranbval_sdk import load_ranbval, secure_client

load_ranbval()
client = secure_client(
    openai.OpenAI,
    env_var="OPENAI_API_KEY",
    key_kwarg="api_key",
    method_path_to_patch="chat.completions.create",  # optional: telemetry after each call
)
client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "hi"}],
)
import anthropic
from ranbval_sdk import load_ranbval, secure_client

load_ranbval()
claude = secure_client(
    anthropic.Anthropic,
    env_var="ANTHROPIC_API_KEY",
    key_kwarg="api_key",
    method_path_to_patch="messages.create",
)
import stripe
from ranbval_sdk import load_ranbval, secure_client

load_ranbval()
stripe_client = secure_client(
    stripe.StripeClient,
    env_var="STRIPE_SECRET_KEY",
    key_kwarg="api_key",
)

Lower-level: build_secure_client(SDKClass, env_var_name, key_kwarg, method_path_to_patch=None) returns a class you can reuse or subclass.

Low-level decrypt

from ranbval_sdk import safe_decrypt

plain = safe_decrypt("ranbval.noise.blob.ahsan", os.environ["RANBVAL_VAULT_SECRET"])

Telemetry

When you pass method_path_to_patch, the wrapper posts platform-style metadata to POST {RANBVAL_HOST}/api/telemetry on a background thread after that method returns (no token usage parsing — that stays generic).

Variable Meaning
RANBVAL_HOST Password-manager origin (no /api). Defaults to hosted service.
RANBVAL_TELEMETRY 0 / false / off — disable
RANBVAL_TELEMETRY_DEBUG 1 / true — print POST failures to stderr

Auth service URL is not RANBVAL_HOST — telemetry goes to the password-manager API only.

SSL on macOS: certifi is used for HTTPS; pip install -U certifi if verify fails.

Git remote allowlist

Variable Meaning
RANBVAL_HOST Same origin as telemetry (/api/public/repo-policy).
RANBVAL_SKIP_REPO_CHECK 1 / true — skip (dev only).

See ranbval-password-manager README for ingest schema and dashboard behavior.

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

ranbval_sdk-0.4.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

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

ranbval_sdk-0.4.0-cp312-cp312-macosx_26_0_arm64.whl (12.3 kB view details)

Uploaded CPython 3.12macOS 26.0+ ARM64

File details

Details for the file ranbval_sdk-0.4.0.tar.gz.

File metadata

  • Download URL: ranbval_sdk-0.4.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.12.0 Darwin/25.4.0

File hashes

Hashes for ranbval_sdk-0.4.0.tar.gz
Algorithm Hash digest
SHA256 0a57673d74b82c479e8181be186061376415ab246a94017a068a5032552a30e0
MD5 478918f7e6d338e0a7f3e2d3acc7af8f
BLAKE2b-256 60b2da6be495fbc44257c89bad35fc262b07b71a06559c303a6a392c5008dae1

See more details on using hashes here.

File details

Details for the file ranbval_sdk-0.4.0-cp312-cp312-macosx_26_0_arm64.whl.

File metadata

File hashes

Hashes for ranbval_sdk-0.4.0-cp312-cp312-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 544e825eb94a3d42dc138c722474cd542aac41c288531e82880348509094ff76
MD5 a8261c1b6a34d4f35851c378dc3dabff
BLAKE2b-256 92af7a6b9d5851e1a20644fa636432fbda8ec59168a3589efce8a61112b83575

See more details on using hashes here.

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