Shipeasy
ReferencePython

Shipeasy Python SDK — Overview

shipeasy is the server SDK for Shipeasy — feature flags, remote configs, kill switches, A/B experiments, and metric tracking. It uses your server key and…

Generated from the SDK's own /docs/ — also served raw at https://shipeasy-ai.github.io/sdk-python/pages/overview.md.

shipeasy is the server SDK for Shipeasy — feature flags, remote configs, kill switches, A/B experiments, and metric tracking. It uses your server key and must never be embedded in a browser.

Mental model: configure() once, then Client(user) per request

There are exactly two things to learn:

  1. configure() — call it once at process start with your server key and an optional attributes transform (your user object → the Shipeasy attribute map). This is the whole setup story.
  2. shipeasy.Client(user) — construct a cheap, user-bound handle per request and read with no user argument (the user is bound at construction).
import shipeasy

shipeasy.configure(
    api_key="sdk_server_...",
    attributes=lambda u: {"user_id": u.id, "country": u.country, "plan": u.plan},
)

# construct once per callsite (cheap; binds the user)
client = shipeasy.Client(current_user)

if client.get_flag("new_checkout"):
    ...
config = client.get_config("billing_copy")
result = client.get_experiment("checkout_button", default_params={"color": "blue"})
client.log_exposure("checkout_button")    # at the decision point
client.track("purchase", {"amount": 49})  # on conversion

What the bound Client does

Everything you need per request is on Client(user) — no user argument on any call:

  • get_flag(name, default=False) · get_flag_detail(name)
  • get_config(name, decode=None, default=None)
  • get_killswitch(name, switch_key=None)
  • get_experiment(name, default_params, decode=None)
  • log_exposure(experiment_name) · track(event, properties=None)

So an experiment is end-to-end Client-only. Constructing a Client(user) before configure() raises RuntimeError.

The configure family

callwhen
configure(api_key=...)production — your server key
configure_for_testing(...)unit tests — no network, seed overrides
configure_for_offline(...)evaluate real rules from a snapshot / file

After any of them, you read the same way: shipeasy.Client(user).

Feature pages

  • installationpip install shipeasy, frameworks, configure()
  • configurationconfigure(), keys, attributes, one-shot vs poll, options
  • flagsget_flag, get_flag_detail, defaults
  • configsget_config, typed decode, defaults
  • killswitchesget_killswitch
  • experimentsget_experiment, ExperimentResult, log_exposure, track
  • i18n — cross-SDK loader story (server SDK has no t())
  • error-reportingsee() structured reporting
  • testingconfigure_for_testing, configure_for_offline, overrides
  • openfeatureShipeasyProvider
  • advanced — anon-id middleware, private attrs, sticky bucketing, manual exposure, SSR
Was this page helpful?
✎ Edit this page

On this page