Skip to main content

Python client for the f69-edge HTTP API

Project description

f69-edge (Python SDK)

Small httpx-based client for the f69-edge HTTP API.

Requires Python 3.12+.

Install

pip install f69

Usage

import os

from f69 import F69EdgeClient, F69EdgeError

client = F69EdgeClient(
    base_url=os.environ.get("F69_EDGE_URL", "http://127.0.0.1:8081"),
    # From control plane: POST .../service-accounts - use bearer_token or `<id>.<secret_key>`.
    # Tokens are reader (evaluate only) or writer (identify + evaluate); each token is bound to one environment.
    api_key=os.environ["F69_SERVICE_ACCOUNT_BEARER"],
)

client.health()  # GET /health (no auth)

client.identify(
    type="user",
    external_id="user_42",
    attributes={"plan": "pro", "region": "eu"},
)

flags = client.evaluate(id="user_42", type="user")
# flags → [
#   {"key": "new_checkout", "value": True, "reason": "TARGETING_MATCH", "version": "live"},
#   ...
# ]

client.close()

Evaluate semantics

POST /v1/evaluate takes {"id", "type"} and optional "keys". Omit keys to evaluate every workspace flag; pass a non-empty keys list to evaluate only those feature keys. The server looks up the entity in the token's environment (it must have been identified first via /v1/identify) and replies with a list of results. Each entry carries key, value, reason (one of TARGETING_MATCH, SPLIT, DEFAULT, FALLBACK, ERROR), and a manifest version string.

Use as a context manager to close the underlying HTTP client:

with F69EdgeClient(base_url="http://127.0.0.1:8081", api_key="...") as client:
    client.health()

Errors on non-2xx responses raise F69EdgeError with status, url, and parsed body when available.

API surface

Method HTTP Auth
health() GET /health No
identify(*, type, external_id, attributes=None, label=UNSET) POST /v1/identify Authorization: Bearer <serviceAccountId>.<secretKey>
evaluate(*, id, type, keys=None) POST /v1/evaluate Same

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

f69-0.1.6.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

f69-0.1.6-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file f69-0.1.6.tar.gz.

File metadata

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

File hashes

Hashes for f69-0.1.6.tar.gz
Algorithm Hash digest
SHA256 eaae368a982150a3e066410a69c80079cf78563edb81dfdb1d56385c42eabb57
MD5 862994f87d2a7f0c86790f579e9c9983
BLAKE2b-256 533e8fcb1b3887611402db0cd4bbc3aadd5aee71cb2bfe48d953f2a40f2aa02f

See more details on using hashes here.

Provenance

The following attestation bundles were made for f69-0.1.6.tar.gz:

Publisher: sdk-python-release.yml on rubbieKelvin/f69

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

File details

Details for the file f69-0.1.6-py3-none-any.whl.

File metadata

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

File hashes

Hashes for f69-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 094e50ea05b4d5fe0837b37620e8c6ccec74af1e1f8250373e06af40a0729ca3
MD5 bc6021f902138a9c7f100f647835adc0
BLAKE2b-256 da2d3db16d78ecef9dcf82d3ea36ccbfac3d5c2dc0f14dd9e7518a43e4c11c24

See more details on using hashes here.

Provenance

The following attestation bundles were made for f69-0.1.6-py3-none-any.whl:

Publisher: sdk-python-release.yml on rubbieKelvin/f69

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