Skip to main content

Shipeasy server SDK for Python — feature flags, configs, experiments, metrics.

Project description

shipeasy (Python)

Server SDK for Shipeasy — feature flags, remote configs, A/B experiments, and metric tracking. Server-key only, never embed in browsers.

pip install shipeasy
from shipeasy import Client

client = Client(api_key="sdk_server_...")
client.init()  # background poll; use init_once() for serverless

if client.get_flag("new_checkout", {"user_id": "u_123", "country": "US"}):
    ...

config = client.get_config("billing_copy")

result = client.get_experiment(
    "checkout_button",
    user={"user_id": "u_123"},
    default_params={"color": "blue"},
)
print(result.in_experiment, result.group, result.params)

client.track("u_123", "purchase", {"amount": 49})

Anonymous visitors (zero-config bucketing)

For logged-out traffic you need a stable unit so a fractional rollout buckets the same on the server and in the browser. The middleware mints a first-party __se_anon_id cookie (shared with every Shipeasy SDK) for any request without one; evaluations then default to it as anonymous_id, so get_flag on an anonymous request just works — no per-call wiring.

# WSGI (Flask, Django, ...)
from shipeasy.middleware import AnonIdMiddleware
app.wsgi_app = AnonIdMiddleware(app.wsgi_app)

# ASGI (FastAPI, Starlette)
from shipeasy.middleware import AnonIdASGIMiddleware
app.add_middleware(AnonIdASGIMiddleware)
# logged-out request → buckets on the __se_anon_id cookie automatically
client.get_flag("new_checkout", {})

An explicit user_id/anonymous_id always wins. The id is also on the request (environ["shipeasy.anon_id"]). The cookie is non-HttpOnly by design so the browser SDK buckets identically; a request with no unit still resolves a fully-rolled (100%) gate as on. Cookie name + format are a cross-SDK contract — see 18-identity-bucketing.md.

Evaluation

Tested against the cross-language MurmurHash3 vectors in experiment-platform/04-evaluation.md.

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

shipeasy-0.3.0.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

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

shipeasy-0.3.0-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file shipeasy-0.3.0.tar.gz.

File metadata

  • Download URL: shipeasy-0.3.0.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for shipeasy-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e1036d124a73c02dcd9eb3bf55f20f4259d29bae9108accbb9a6a79d045b2b43
MD5 c2186426d524e3e5b314d2b8050a653c
BLAKE2b-256 be997f96b8f70c313792993332193faca95f212be892e5ae477837368bc39050

See more details on using hashes here.

Provenance

The following attestation bundles were made for shipeasy-0.3.0.tar.gz:

Publisher: publish.yml on shipeasy-ai/sdk-python

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

File details

Details for the file shipeasy-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: shipeasy-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for shipeasy-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aaaff3fc5790dc856ac440ba3ba2cc5dc34d06a0009ffa5779d607af48e7e6d0
MD5 f5fe71d0e82ab1f123436cf99e4a0b0a
BLAKE2b-256 881389a00d3efebf9eef39d91e06db8a574208383c57c1a251d939286c672571

See more details on using hashes here.

Provenance

The following attestation bundles were made for shipeasy-0.3.0-py3-none-any.whl:

Publisher: publish.yml on shipeasy-ai/sdk-python

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