You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/docs/tracking-methods/sdks/python/python-flags.mdx
+27-11Lines changed: 27 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,10 +2,6 @@ import { Callout } from 'nextra/components'
2
2
3
3
# Implement Feature Flags (Python)
4
4
5
-
<Callouttype="info">
6
-
The Python server-side SDK is currently in Beta.
7
-
</Callout>
8
-
9
5
## Overview
10
6
11
7
This developer guide will assist you in configuring your server-side Python platform for [Feature Flags](/docs/featureflags) using the [Mixpanel Python SDK](/docs/tracking-methods/sdks/python). Feature Flags allow you to control the rollout of your features, conduct A/B testing, and manage application behavior without deploying new code.
@@ -14,17 +10,19 @@ This developer guide will assist you in configuring your server-side Python plat
14
10
15
11
Before implementing [Feature Flags](/docs/featureflags), ensure:
16
12
17
-
- You are on an Enterprise subscription plan and have the appropriate version of the SDK installed (minimum supported version is [`v5.0.0b2`](https://github.com/mixpanel/mixpanel-python). If not, please follow [this doc](/docs/quickstart/install-mixpanel) to install the SDK.
13
+
- You are on an Enterprise subscription plan and have the appropriate version of the SDK installed (minimum supported version is [`v5.0.0`](https://github.com/mixpanel/mixpanel-python). If not, please follow [this doc](/docs/quickstart/install-mixpanel) to install the SDK.
18
14
- You have your Project Token from your [Mixpanel Project Settings](/docs/orgs-and-projects/managing-projects#find-your-project-tokens)
19
15
20
-
## Flag Evaluation Modes
16
+
## Flag Evaluation Scenarios
21
17
22
-
There are two modes available for using the python SDK for feature flagging, Local Evaluation and Remote Evaluation.
18
+
There are two scenarios available for using the python SDK for feature flagging, Local Evaluation and Remote Evaluation.
23
19
24
20
For local evaluation, the SDK will poll Mixpanel servers for feature flag configurations. Assignment of user contexts to variants will be done locally within the SDK. This mode is recommended for low latency since there is no network call made at assignment time.
25
21
26
22
For remote evaluation, the SDK will make a network call to Mixpanel servers at assignment time. This mode is recommended for use cases where you want to leverage Mixpanel cohorts for user targeting or sticky variants for persistent variant assignments.
27
23
24
+
In either case there is also the capability to evaluate all flags for a given user context at once, to avoid needing to make multiple calls to get individual flag variants for the same user. This is particularly useful for remote evaluation to avoid incurring additional network calls.
25
+
28
26
## Local Evaluation
29
27
30
28
<Callouttype="warning">
@@ -66,6 +64,8 @@ user_context = {
66
64
}
67
65
}
68
66
67
+
# Gets the assigned variant for the flag for the given user context.
68
+
# This will return the fallback_variant if the user context is not in an assignment group for the flag.
# Given a flag key and the selected variant for that key, manually track an exposure event for a given flag and assigned variant, after exposing the user to the variant
0 commit comments