Flipt Client Evaluation SDK
Project description
Flipt Client Python
The flipt-client-python
library contains the Python source code for the Flipt client-side evaluation client.
Installation
pip install flipt-client
Supported Architectures
This SDK currently supports the following OSes/architectures:
- Linux x86_64
- Linux arm64
- MacOS x86_64
- MacOS arm64
Usage
In your Python code you can import this client and use it as so:
from flipt_client import FliptEvaluationClient
# "namespace" and "engine_opts" are two keyword arguments that this constructor accepts
# namespace: which namespace to fetch flag state from
# engine_opts: follows the model EngineOpts in the models.py file. Configures the url of the upstream Flipt instance, the interval in which to fetch new flag state, and the authentication method if your upstream Flipt instance requires it
flipt_evaluation_client = FliptEvaluationClient()
variant_result = flipt_evaluation_client.evaluate_variant(flag_key="flag1", entity_id="entity", context={"fizz": "buzz"})
print(variant_result)
Constructor Arguments
The FliptEvaluationClient
constructor accepts two optional arguments:
namespace
: The namespace to fetch flag state from. If not provided, the client will default to thedefault
namespace.engine_opts
: An instance of theEngineOpts
class that supports several options for the client. The structure is:url
: The URL of the upstream Flipt instance. If not provided, the client will default tohttp://localhost:8080
.update_interval
: The interval (in seconds) in which to fetch new flag state. If not provided, the client will default to 120 seconds.authentication
: The authentication strategy to use when communicating with the upstream Flipt instance. If not provided, the client will default to no authentication. See the Authentication section for more information.reference
: The reference to use when fetching flag state. If not provided, reference will not be used.
Authentication
The FliptEvaluationClient
supports the following authentication strategies:
- No Authentication (default)
- Client Token Authentication
- JWT Authentication
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
flipt_client-0.9.0.tar.gz
(16.0 MB
view details)
Built Distribution
File details
Details for the file flipt_client-0.9.0.tar.gz
.
File metadata
- Download URL: flipt_client-0.9.0.tar.gz
- Upload date:
- Size: 16.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.0 CPython/3.11.9 Linux/6.5.0-1023-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 437da7ec4f747450e1104eedb58f2e183dd231aaa9cac522fc636c8304f8eb1e |
|
MD5 | 2af0e18b8fe9bc8503a3b816ba5025d3 |
|
BLAKE2b-256 | f0d8109385598b80af0c3d5e1747010ebcdd6fdd286124879f075ecd6b05f183 |
File details
Details for the file flipt_client-0.9.0-py3-none-any.whl
.
File metadata
- Download URL: flipt_client-0.9.0-py3-none-any.whl
- Upload date:
- Size: 16.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.0 CPython/3.11.9 Linux/6.5.0-1023-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2a8ce98bcbf98e9ffd297f87be338c5b2498e5d3e3cf9b012c180106a6dc504 |
|
MD5 | 15c61cb930921b9f30e4f03d4d5ff055 |
|
BLAKE2b-256 | 25f5f6811a0d4e0a4653a640b30fd087b6258a7c6ce7dc98a4318e94a761351b |