Skip to main content

feat feature-flag SDK for Python (server-side, local evaluation)

Project description

feat.so


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 (every 30 seconds by default, configurable; ETag-aware via If-None-Match). If the stream drops, the poll keeps the datafile fresh while 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

feat_sdk-0.3.0.tar.gz (25.2 kB view details)

Uploaded Source

Built Distribution

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

feat_sdk-0.3.0-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for feat_sdk-0.3.0.tar.gz
Algorithm Hash digest
SHA256 792d08e754597de301f8b0e6691e3ec5911db4da7f87b7878158adfe723bcb3f
MD5 a06d3a3f4aa419b85816a0f4bf3847b3
BLAKE2b-256 4f9560f493a5a5a69e1e1dc5b6d7f8110d3c4eeb45b7376ef6d07cbc177e8b71

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on feathq/python-sdk

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

File details

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

File metadata

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

File hashes

Hashes for feat_sdk-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bf5b1665bf7f1cc76f55c0af1682c06f5de41a392931a4e10e8b187422f6eab6
MD5 e9b74b2918ed733afe9e31c8285e5e1d
BLAKE2b-256 985814542fa44d7897de56bb215efe70aa131e9ae3758e0be2662eace0d8feaa

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on feathq/python-sdk

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