NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #2064 most downloaded on PyPI
Statsig Python Server SDK
Last release 1 months ago
19 Aug 2026
Release timing varies
gaps range from 8 days to 4 months
Nearly every release is documented
notes for 59 of the last 60 stable releases
9 versions withdrawn
withdrawn after publishing
5 years old
150 releases · first in 2021
One column per quarter.
Event timestamp was incorrectly statically set. So every event from the python SDK had the same timestamp. This fixes that bug
Event timestamp was incorrectly statically set. So every event from the python SDK had the same timestamp. This fixes that bug
Adds get_client_initialize_response(StatsigUser). This can be used to generate the initialize response for a given user to be used in a client SDK. If
Adds get_client_initialize_response(StatsigUser). This can be used to generate the initialize response for a given user to be used in a client SDK. If you compute this using the python server SDK, you can bootstrap a statsig client SDK with the result and remove a network round trip to statsig
Also ID list updates to improve reliability and monitoring
Nothing published for this version
Adds event_queue_size parameter to StatsigOptions to make the number of events to batch before flushing to Statsig configurable. Defaults to 500 as be
Adds event_queue_size parameter to StatsigOptions to make the number of events to batch before flushing to Statsig configurable. Defaults to 500 as before.
Also, internally, wraps, catches, and logs exceptions to statsig via ErrorBoundary so we can debug errors
Rather than logging as exception, log internal SDK messages as warn
Rather than logging as exception, log internal SDK messages as warn
We were logging the wrong secondary_exposure array on statsig::layer_exposure
We were logging the wrong secondary_exposure array on statsig::layer_exposure
Type the singleton statsig methods
Type the singleton statsig methods
Typing input as StatsigUser instead of object, typing log events, the value of log events as number or string, and optional types for nullable fields
Typing input as StatsigUser instead of object, typing log events, the value of log events as number or string, and optional types for nullable fields across StatsigOptions, StatsigUser, and StatsigEvent
fixed "before" and "after" operator for Time based conditions
fixed "before" and "after" operator for Time based conditions
Now the SDK only requires either a userID or any customID
Now the SDK only requires either a userID or any customID
Nothing published for this version
Previously exposures for Layers happen when you call getLayer(), but when you have multiple experiments running in parallel in the same Layer, this co
Previously exposures for Layers happen when you call getLayer(), but when you have multiple experiments running in parallel in the same Layer, this could be exposing more users than the actual number of users who were actually exposed to some of the experiments, so with this release we have moved the exposure logic to be happening when Layer.get() method is called, so that a user is only exposed to an experiment when the parameter for that experiment is fetched.
Add debug logging information, stringify user object more gracefully, add server session id header, copy user on normalization rather than modifying
Add debug logging information, stringify user object more gracefully, add server session id header, copy user on normalization rather than modifying
added a new API get_layer, which returns a layer object that would return the correct parameter value for the given user within the layer, no matter w
get_layer, which returns a layer object that would return the correct parameter value for the given user within the layer, no matter which experiment the user is allocated to within the layer;time was not added to events;/get_config fallback was not correctly called in the event that the SDK does not know how to evaluate a rule locally.Improved the ID list sync'ing logic so that it's using a new endpoint and can scale better with larger lists
Improved the ID list sync'ing logic so that it's using a new endpoint and can scale better with larger lists
Added two parameters to StatsigOptions:
Added two parameters to StatsigOptions:
bootstrap_values: str = null
a string that represents all rules for all feature gates, dynamic configs and experiments. It can be provided to bootstrap the Statsig server SDK at initialization in case your server runs into network issue or Statsig server is down temporarily.
rules_updated_callback: typing.Callable = None,
a callback function that's called whenever we have an update for the rules; it's called with a logical timestamp and a JSON string (used as is for bootstrapValues mentioned above). Note that as of right now, this will be called from a background thread that the SDK uses to update config values.
Fixes and issue where the ID list background thread updater threw an exception when trying to remove IDs from a list when the ID already did not exist
Fixes and issue where the ID list background thread updater threw an exception when trying to remove IDs from a list when the ID already did not exist
The shutdown API had an issue where the background threads were waiting to be joined in shutdown in localMode per #4
The shutdown API had an issue where the background threads were waiting to be joined in shutdown in localMode per #4
The override APIs were improperly preferring global to user level settings, so if you had a user level override and a global override, you would always get the global override. This made it impossible to override a gate to true for all but one user
Nothing published for this version
override_gate(gate:str, value:bool, user_id:str = None) - overrides a gate to the given value. If a user_id is not provided, all gate checks will retu
override_gate(gate:str, value:bool, user_id:str = None) - overrides a gate to the given value. If a user_id is not provided, all gate checks will return this value. If a specific user_id is passed, the override only applies to that given user_id
override_config and override_experiment function similarly, but for DynamicConfigs and Experiments
StatsigOptions.local_mode- local mode disables network access, so the SDK will only return default values and never hit statsig servers. Useful for unit testing
evaluate_all(user) - given a user, evaluates all gates/configs/experiments in the project and returns a dictionary with the results. Useful for reproducing an issue and determining which values a given user has
Example output:
"feature_gates":{
"always_on_gate":{
"value": True,
"rule_id":"6N6Z8ODekNYZ7F8gFdoLP5"
},
"on_for_statsig_email":{
"value": True,
"rule_id":"7w9rbTSffLT89pxqpyhuqK"
}
},
"dynamic_configs":{
"test_config":{
"value":{
"boolean": False,
"number":7,
"string":"statsig"
},
"rule_id":"1kNmlB23wylPFZi1M0Divl"
},
"sample_experiment":{
"value":{
"experiment_param":"test"
},
"rule_id":"2RamGujUou6h2bVNQWhtNZ"
}
}
Adds python SDK support for ID lists: https://docs.statsig.com/segments/add-id-list
Enforces a minimum timeout on network requests from the SDK, and makes that timeout configurable via StatsigOptions
Enforces a minimum timeout on network requests from the SDK, and makes that timeout configurable via StatsigOptions
All SDK background threads are now marked as daemon threads so they will not continue to run when your program exits.
All SDK background threads are now marked as daemon threads so they will not continue to run when your program exits.
Note that if you fail to call shutdown(), the background thread that posts logs to Statsig servers will not have a chance to run and you could lose logging data
Nothing published for this version
Adds custom_ids to the StatsigUser class, which can be used to specify experiment randomization unit IDs other than the standard userID and stableID,
Adds custom_ids to the StatsigUser class, which can be used to specify experiment randomization unit IDs other than the standard userID and stableID, e.g. to experiment on account IDs, you can add accountID as a new ID type in Statsig console, and set it on the user in code.
This SDK is for server side, multi-user environment usage. Check out our docs for details on how to use the SDK.
This SDK is for server side, multi-user environment usage. Check out our docs for details on how to use the SDK.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →