Skip to content

Releases: flaggr-dev/flaggr-python

Release list

v0.1.1

Choose a tag to compare

@github-actions github-actions released this 08 Oct 13:05

Fixes from a review of 0.1.0. Upgrade with:

pip install "flaggr @ git+https://github.com/flaggr-dev/flaggr-python@v0.1.1"

The wheel and the source distribution are attached below. The package isn't on PyPI yet; 0.1.1 will be the first version uploaded there.

Fixes

  • httpx is limited to versions before 1.0 (httpx>=0.24.0,<1). The httpx 1.0 pre-releases remove the API the SDK uses, so 0.1.0 failed with TypeError whenever a resolver picked one, for example with pip install --pre.
  • The targeting key is sent as a string. https://api.flaggr.dev ignores a targeting key that isn't a string, so with 0.1.0 an integer user ID ({"targeting_key": 42}) got no percentage rollouts, variant splits or per-user overrides. Keys of other types are now converted with str().
  • Context attributes set to None are left out. https://flaggr.dev rejected the whole evaluation with HTTP 400 when an attribute was None.
  • Whitespace around service_id and environment is stripped, as it already was for api_key, so a value read from an environment variable that ends with a newline works. An empty environment raises ValueError.
  • Clearer errors: when the server redirects (an http:// api_url), the error names the api_url to use, and HTML error pages are left out of error messages.

Other changes

  • README: a working OpenFeature example (OFREP provider), absolute links so the page renders on PyPI, and notes on how the targeting key, None values and JSON arrays are handled.
  • Python 3.14 is tested and listed. On 3.14, httpx itself needs 0.26 or later.
  • The release workflow runs the tests before it builds, and pins pypa/gh-action-pypi-publish to a commit.

Full Changelog: v0.1.0...v0.1.1

v0.1.0

Choose a tag to compare

@github-actions github-actions released this 08 Oct 08:24

Superseded by v0.1.1. It limits httpx to versions before 1.0 and fixes integer targeting keys; install it instead. 0.1.0 won't be published to PyPI.

First release of the Flaggr Python SDK.

pip install "flaggr @ git+https://github.com/flaggr-dev/flaggr-python@v0.1.0"

The wheel and the source distribution are attached below. The package isn't on PyPI yet.

  • FlaggrClient and AsyncFlaggrClient evaluate flags with POST /api/flags/evaluate on https://api.flaggr.dev (configurable with api_url).
  • get_boolean, get_string, get_number and get_object return the value, or your default when the flag doesn't exist or has another type.
  • resolve_* return an EvaluationDetail with the reason, the variant, an error code (FLAG_NOT_FOUND, TYPE_MISMATCH) and flag metadata.
  • Failed requests raise FlaggrError (FlaggrTimeoutError for timeouts) with the HTTP status.
  • Python 3.9 to 3.13, httpx 0.24 or later, typed (py.typed).

Docs: https://flaggr.dev/docs/sdk/python-sdk

Full Changelog: https://github.com/flaggr-dev/flaggr-python/commits/v0.1.0