feat feature-flag SDK for Python (server-side, local evaluation)
Project description
feat Python SDK
Server-side Python SDK for feat feature flags. Local flag evaluation against a polled datafile. Zero runtime dependencies (stdlib only).
Install
pip install feat-sdk
Python 3.10+.
Usage
from feat import Client, ClientConfig, EvalContext
client = Client(ClientConfig(
api_key="feat_sdk_...",
url="https://data-01.feat.so", # optional; this is the default
))
client.ready()
ctx = EvalContext(
targeting_key="user-123",
kinds={"user": {"plan": "pro", "email": "alice@example.com"}},
)
if client.get_boolean_value("checkout-v2", False, ctx):
# ...
pass
client.close()
Use a server API key (feat_sdk_...).
How it works
- Fetches a per-environment datafile and keeps it in memory.
- Streams live updates by default over Server-Sent Events: a background thread holds the connection and applies each pushed datafile the moment it changes.
- A background poll runs alongside the stream as a safety net. Its cadence
follows stream health: while the stream is connected the poll runs at a slow
10-minute interval (the stream is the live path, so the poll only guards
against a silently wedged connection); when streaming is off or the stream
drops, the poll reverts to the normal interval (
poll_interval_seconds, 30s by default and configurable) and becomes the primary refresh path. A dropped stream switches back to the fast interval immediately. Polls are ETag-aware viaIf-None-Match, and the stream reconnects with exponential backoff. - Updates are version-ordered: a datafile is adopted only when its version is strictly newer than the one in memory, so the stream and poll never clobber each other.
- Evaluation runs in-process: no per-flag network call.
close()stops the stream and poll threads cleanly.
Disabling streaming
Set streaming=False to rely on polling alone:
client = Client(ClientConfig(api_key="feat_sdk_...", streaming=False))
License
MIT
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
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 feat_sdk-0.3.1.tar.gz.
File metadata
- Download URL: feat_sdk-0.3.1.tar.gz
- Upload date:
- Size: 27.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
efe750923435bc29ab382513d6326912475f3e2e1174add274d5a6da771e8ecc
|
|
| MD5 |
7f94cb1f6e875530c92da64ee251fb70
|
|
| BLAKE2b-256 |
6058a65016fffdafd139982710ec5479da801779eaa5db794a7879ee69f03366
|
Provenance
The following attestation bundles were made for feat_sdk-0.3.1.tar.gz:
Publisher:
publish.yml on feathq/python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
feat_sdk-0.3.1.tar.gz -
Subject digest:
efe750923435bc29ab382513d6326912475f3e2e1174add274d5a6da771e8ecc - Sigstore transparency entry: 2119357147
- Sigstore integration time:
-
Permalink:
feathq/python-sdk@45d72016e21e34616ae2ca4a1172aea952c8027f -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/feathq
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@45d72016e21e34616ae2ca4a1172aea952c8027f -
Trigger Event:
push
-
Statement type:
File details
Details for the file feat_sdk-0.3.1-py3-none-any.whl.
File metadata
- Download URL: feat_sdk-0.3.1-py3-none-any.whl
- Upload date:
- Size: 21.6 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 |
2360e649e825daa8b1545d1e63b60feadc25c73d87e79423ccbdc0a0e5a3e99b
|
|
| MD5 |
c6b359b25fe0d1a2b0fd534c22481746
|
|
| BLAKE2b-256 |
27853b0ceda7c8673a286fe11d1bbc5b8e2ef6cd2467d82612ee9c52fa9db51e
|
Provenance
The following attestation bundles were made for feat_sdk-0.3.1-py3-none-any.whl:
Publisher:
publish.yml on feathq/python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
feat_sdk-0.3.1-py3-none-any.whl -
Subject digest:
2360e649e825daa8b1545d1e63b60feadc25c73d87e79423ccbdc0a0e5a3e99b - Sigstore transparency entry: 2119357209
- Sigstore integration time:
-
Permalink:
feathq/python-sdk@45d72016e21e34616ae2ca4a1172aea952c8027f -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/feathq
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@45d72016e21e34616ae2ca4a1172aea952c8027f -
Trigger Event:
push
-
Statement type: