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 .../projects/<project>/service-accounts - use bearer_token or `<id>.<secret_key>`.
    # Tokens are reader (evaluate only) or writer (identify + evaluate); each token is bound to one project + 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 feature in the token's project; pass a non-empty keys list to evaluate only those feature keys. The server looks up the entity in the token's project + 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 scoped to that project/environment.

Project scope

Service-account tokens now scope to a project + environment, not to a whole workspace. Create a project in control first, then mint tokens under it. After upgrading from a pre-project release, the server invalidates old tokens and returns HTTP 401 token_reissue_required until a new token is issued from the dashboard.

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.7.tar.gz (8.4 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.7-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: f69-0.1.7.tar.gz
  • Upload date:
  • Size: 8.4 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.7.tar.gz
Algorithm Hash digest
SHA256 26a9dd8aa3e755a3ebf16666726ab695771f7f7f566e930d6da13ad5f4ff8bec
MD5 4225d67ee5295b7e435e03ac8ffb7aad
BLAKE2b-256 a4dc9f59f5087571e987c18a850834bcb701f68469b4d9beacd0df07ff70a45a

See more details on using hashes here.

Provenance

The following attestation bundles were made for f69-0.1.7.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.7-py3-none-any.whl.

File metadata

  • Download URL: f69-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 5.6 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 4aa5ba50a8609697506a7b059614436137e162225a444c3e6830a2d8c320b9f6
MD5 72e4f33156ec9f71a4adb054bfb4ef97
BLAKE2b-256 0397216a0c2b137d8f32d7d1850cfd47375e682b2ca9ea2bef7607630b3cd493

See more details on using hashes here.

Provenance

The following attestation bundles were made for f69-0.1.7-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