Skip to main content

Flipt Client Evaluation SDK

Project description

Flipt Client Python

pypi

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
  • Windows x86_64

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 the default namespace.
  • engine_opts: An instance of the EngineOpts 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 to http://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:

Contributing

Contributions are welcome! Please feel free to open an issue or submit a Pull Request.

License

This project is licensed under the MIT License.

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

flipt_client-0.11.0.tar.gz (18.3 MB view details)

Uploaded Source

Built Distribution

flipt_client-0.11.0-py3-none-any.whl (18.4 MB view details)

Uploaded Python 3

File details

Details for the file flipt_client-0.11.0.tar.gz.

File metadata

  • Download URL: flipt_client-0.11.0.tar.gz
  • Upload date:
  • Size: 18.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.0 CPython/3.11.10 Linux/6.5.0-1025-azure

File hashes

Hashes for flipt_client-0.11.0.tar.gz
Algorithm Hash digest
SHA256 824b468fc4ba78ddc21773ebdabf0b592a55eee9d0fe48a5e72c7609a5ce91b0
MD5 b267c9d7ec8ec3d43d30817e832f32c8
BLAKE2b-256 af4784f259c30a473118b36be926af10fe806aa346bca82884925c3011174056

See more details on using hashes here.

File details

Details for the file flipt_client-0.11.0-py3-none-any.whl.

File metadata

  • Download URL: flipt_client-0.11.0-py3-none-any.whl
  • Upload date:
  • Size: 18.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.0 CPython/3.11.10 Linux/6.5.0-1025-azure

File hashes

Hashes for flipt_client-0.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 01249360840b5ac5203e34ea7cb907995a53b3a393eeb9f801e3c031df132eaa
MD5 5cd14290b5b07a82fe3644a26f13f2e4
BLAKE2b-256 3a85354e4ee7b217f110e666b3a32c8fd7b7ece708975584ec82476d5c2a64b7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page