Official Python SDK for SignaKit Feature Flags.
Project description
@signakit/flags-python
Official Python SDK for SignaKit Feature Flags.
Fetches flag configurations from SignaKit's CloudFront CDN and evaluates them locally with consistent bucketing across all SignaKit SDKs (Node.js, Browser, React, PHP, Laravel, Python).
- Async-first — async/await with
httpx(sync API also available) - Type-safe —
mypy --strictclean, fully type-annotated - Cross-language consistent — MurmurHash3-based bucketing produces the same
variation for the same
userIdin every SDK - Bot detection — bots get the
offvariation and are excluded from events - Targeted-rule exposures skipped — exposure events are only fired for experiments (A/B tests, multi-armed bandits), not for simple feature rollouts
Installation
pip install signakit-flags
Requires Python 3.11+.
Quick start
import asyncio
from signakit_flags import SignaKitClient
async def main() -> None:
client = SignaKitClient(sdk_key="sk_dev_orgId_projectId_random")
ready = await client.on_ready()
if not ready.success:
print(f"SignaKit not ready: {ready.reason}")
return
user = client.create_user_context(
user_id="user-123",
attributes={"plan": "premium", "country": "US"},
)
if user is None:
return
decision = user.decide("new-checkout-flow")
if decision and decision.enabled:
# Show the new checkout flow
...
# Track a conversion event with revenue
await user.track_event("purchase", value=99.99, metadata={"sku": "abc"})
asyncio.run(main())
Synchronous usage
from signakit_flags import SignaKitClient
client = SignaKitClient(sdk_key="sk_prod_orgId_projectId_random")
ready = client.on_ready_sync()
if ready.success:
user = client.create_user_context("user-123")
decision = user.decide("new-checkout-flow") if user else None
API surface
| Symbol | Description |
|---|---|
SignaKitClient(sdk_key=...) |
Create a client. Validates the key shape. |
await client.on_ready() / client.on_ready_sync() |
Fetch the config and mark the client ready. |
client.create_user_context(user_id, attributes) |
Build a per-user evaluator. |
ctx.decide(flag_key) → Decision | None |
Evaluate a single flag. |
ctx.decide_all() → dict[str, Decision] |
Evaluate every non-archived flag. |
await ctx.track_event(event_key, value=..., metadata=...) |
Fire a conversion event. |
is_bot(user_agent) |
Standalone bot-UA detector. |
parse_sdk_key(key) |
Decode an SDK key into org/project/environment. |
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file signakit_flags-1.1.0.tar.gz.
File metadata
- Download URL: signakit_flags-1.1.0.tar.gz
- Upload date:
- Size: 22.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ae9c05fb70370a8d9ece19d1ac5a91a55126d6a2dc4e7728e88b5b3fa0295f8
|
|
| MD5 |
af1d8edca0b1be4e7cd96595b1b6e70e
|
|
| BLAKE2b-256 |
9b4c8e22bef4172204850bba20049478d8a1db3fd1ae92bdd83037e9264b0de9
|
Provenance
The following attestation bundles were made for signakit_flags-1.1.0.tar.gz:
Publisher:
publish-python.yml on SignaKit/signakit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
signakit_flags-1.1.0.tar.gz -
Subject digest:
5ae9c05fb70370a8d9ece19d1ac5a91a55126d6a2dc4e7728e88b5b3fa0295f8 - Sigstore transparency entry: 1438999692
- Sigstore integration time:
-
Permalink:
SignaKit/signakit@88b231b4df33af826aaecefe20abbe0132d38502 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/SignaKit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@88b231b4df33af826aaecefe20abbe0132d38502 -
Trigger Event:
push
-
Statement type:
File details
Details for the file signakit_flags-1.1.0-py3-none-any.whl.
File metadata
- Download URL: signakit_flags-1.1.0-py3-none-any.whl
- Upload date:
- Size: 20.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a8d79c3c6a05da24d1506a2e3d979e213f94ad4efd9c785a1a98ba2c15806a1
|
|
| MD5 |
1971102415e485d567eea45f36e5a666
|
|
| BLAKE2b-256 |
4dcafd82d317a0d2ebc81062ded137ec576a66a6570d70dd836edc5f160aa03f
|
Provenance
The following attestation bundles were made for signakit_flags-1.1.0-py3-none-any.whl:
Publisher:
publish-python.yml on SignaKit/signakit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
signakit_flags-1.1.0-py3-none-any.whl -
Subject digest:
3a8d79c3c6a05da24d1506a2e3d979e213f94ad4efd9c785a1a98ba2c15806a1 - Sigstore transparency entry: 1438999703
- Sigstore integration time:
-
Permalink:
SignaKit/signakit@88b231b4df33af826aaecefe20abbe0132d38502 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/SignaKit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@88b231b4df33af826aaecefe20abbe0132d38502 -
Trigger Event:
push
-
Statement type: