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: health, identify, evaluate, and optional open_api_document.

Requires Python 3.11+.

Install

From the repo root (path dependency) or after publishing:

pip install f69-edge

Local development:

cd sdks/python
pip install -e ".[dev]"

Usage

import os

from f69_edge 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(
    {
        "context": {
            "id": "user_42",
            "type": "user",
            "attributes": {"plan": "pro"},
        },
        "keys": ["new_checkout"],
    }
)
# flags → {"new_checkout": True}

client.close()

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
open_api_document() GET /openapi.json No
identify(body) POST /v1/identify Authorization: Bearer <serviceAccountId>.<secretKey>
evaluate(body) POST /v1/evaluate Same

Request and response types match the edge OpenAPI document (open_api_document()).

License

MIT OR Apache-2.0 (same as the f69 workspace).

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: f69-0.1.1.tar.gz
  • Upload date:
  • Size: 4.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.1.tar.gz
Algorithm Hash digest
SHA256 7bfc571e8a52d4162ba2d89d5061f7c41c313f843f2860624822474d89278120
MD5 f4ecaace5264423c2d92114666f24108
BLAKE2b-256 05ea7b4170260c4366d0f1a19df28cdc6896fa6af97ba69f00e490102d3d0dd3

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: f69-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 1.8 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 400f6ba82ecfe0114305abb11178f271c548c61078dd450a206aa53ce8167cff
MD5 f50e0425f6af5a491af7e2eab2fb8d30
BLAKE2b-256 671eb2fb0fafc8f83d1ea3358aff93ab332dd01e30a05887b9e4dde6d8f7c52c

See more details on using hashes here.

Provenance

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