Skip to main content

Flipt Server SDK

Project description

Flipt Python

pypi

This directory contains the Python source code for the Flipt server-side client.

Documentation

API documentation is available at https://www.flipt.io/docs/reference/overview.

Installation

pip install flipt=={version}

Usage

In your Python code you can import this client and use it as so:

from flipt import FliptClient
from flipt.evaluation import BatchEvaluationRequest, EvaluationRequest

flipt_client = FliptClient()

variant_flag = flipt_client.evaluation.variant(
    EvaluationRequest(
        namespace_key="default",
        flag_key="flagll",
        entity_id="entity",
        context={"fizz": "buzz"},
    )
)

print(variant_flag)

There is a more detailed example in the examples directory.

Setting HTTP Headers

You can set custom HTTP headers for the client by using the headers parameter in the constructor.

flipt_client = FliptClient(headers={"X-Custom-Header": "Custom-Value"})

Flipt V2 Environment Support

Flipt V2 introduces the concept of environments. This client supports evaluation of flags in a specific environment by using the X-Flipt-Environment header.

flipt_client = FliptClient(headers={"X-Flipt-Environment": "production"})

For developers

After adding new code, please don't forget to add unit tests for new features. To format the code, check it with linters and run tests, use the make check command.

Please keep the Python PEP8 in mind while adding new code.

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-1.6.2.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

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

flipt-1.6.2-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file flipt-1.6.2.tar.gz.

File metadata

  • Download URL: flipt-1.6.2.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.0 CPython/3.11.15 Linux/6.14.0-1017-azure

File hashes

Hashes for flipt-1.6.2.tar.gz
Algorithm Hash digest
SHA256 cb1651e0ce1855e643f089a0c9bb7de76108f0a3cc150e6d856adbd29fad8ffb
MD5 9c0e4328dc71f7c99fd9b8f66b5c502e
BLAKE2b-256 e6c16fde5912c2a593b2093798c085cbb781db94adc374de419509023350ed10

See more details on using hashes here.

File details

Details for the file flipt-1.6.2-py3-none-any.whl.

File metadata

  • Download URL: flipt-1.6.2-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.0 CPython/3.11.15 Linux/6.14.0-1017-azure

File hashes

Hashes for flipt-1.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 019006ee392ecb353427f80041d7139487518edc8fd6aa45e37622880bf7c71b
MD5 aa456c7d4c5ba1e7104472fa4754cc12
BLAKE2b-256 1d62f90c764e4deaef5f6edcc9826ea48527794bbbbb10dd88798fa31e9d52df

See more details on using hashes here.

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