Flagsman server SDK: zero-dependency, in-process feature-flag evaluation with streaming updates.
Project description
Flagsman — Python server SDK
Zero-dependency, in-process feature-flag evaluation for Python. The SDK streams your environment's ruleset into memory and evaluates flags locally in microseconds — no network call on your hot path, no per-evaluation charges.
- Local evaluation — decisions are computed in-process from a streamed ruleset.
- Streaming updates — flag changes converge in well under a second (falls back to polling).
- Rigorous — the same
decide()spec every Flagsman SDK implements, asserted by a shared conformance suite. - No dependencies — pure standard library.
Install
pip install flagsman
Usage
from flagsman import FlagsmanClient
client = FlagsmanClient(
base_url="https://api.flagsman.com",
server_key="flags-server-...", # your environment's server-side SDK key
)
client.start()
ctx = {"key": "user-123", "country": "US", "plan": "pro"}
# Boolean flag
if client.bool_variation("checkout.new-payment-flow", ctx, default=False):
render_new_checkout()
# Multivariate flag (string / number / json)
color = client.variation("ui.button-color", ctx, default="blue")
# With evaluation reason (for debugging)
detail = client.variation_detail("ui.button-color", ctx, default="blue")
# Every flag for a context
flags = client.all_flags(ctx)
# Track an experiment goal / conversion
client.track("signup_completed", ctx)
client.stop() # flushes buffered events and stops the stream
Configuration
FlagsmanClient(base_url, server_key, use_stream=True, poll_interval=30.0, request_timeout=10.0, send_events=False, flush_interval=5.0, event_batch_size=25)
use_stream— stream the ruleset (recommended); setFalseto poll.send_events— send exposure/goal analytics events back to Flagsman.
Links
- Documentation: https://docs.flagsman.com
- Homepage: https://flagsman.com
MIT licensed.
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 flagsman-1.0.0.tar.gz.
File metadata
- Download URL: flagsman-1.0.0.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb4466509f664738c4f6f773ca616b52836268798398ad0270c066fd66caa2ee
|
|
| MD5 |
1bf2d481bbb299826fdc4a20ce9dc146
|
|
| BLAKE2b-256 |
c6c434430d33caccbc95fa0a6fbd01d643e4d85515398c57002374a2b950c228
|
File details
Details for the file flagsman-1.0.0-py3-none-any.whl.
File metadata
- Download URL: flagsman-1.0.0-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
910c53c91451969930cb77f561402e8ef9c337ad7525dd10f5491d61db5c540c
|
|
| MD5 |
9072b6b8a528d39f1bb252967ae2ac0a
|
|
| BLAKE2b-256 |
bbb02f0d2529ee44485738eb6bff6b5556cbb650499d2e298f613575deabb718
|