Skip to content

Releases: statsig-io/python-sdk

v0.6.0 - Adds bootstrap_values and rules_updated_callback

04 Mar 01:16
Compare
Choose a tag to compare

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.

v0.5.3 - Fixes and ID list removal bug

17 Feb 00:39
Compare
Choose a tag to compare

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

v0.5.2 - Fixes the localMode and override APIs

12 Jan 00:40
45aaafc
Compare
Choose a tag to compare

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

v0.5.0 - Adds testing utility methods and support for id_lists

17 Dec 19:22
Compare
Choose a tag to compare

Testing utility functions

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"
    }
}

ID Lists

Adds python SDK support for ID lists: https://docs.statsig.com/segments/add-id-list

v0.4.3 - Adds timeout option to make network request timeout configurable

04 Dec 03:44
Compare
Choose a tag to compare

Enforces a minimum timeout on network requests from the SDK, and makes that timeout configurable via StatsigOptions

v0.4.2 - Make background threads daemon threads

03 Dec 22:17
Compare
Choose a tag to compare

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

v0.4.1 [internal] internal event metadata update

10 Nov 01:14
c1a804f
Compare
Choose a tag to compare
Pass statsigMetadata with log events (#29)

* Pass statsigMetadata with log events

* Add test case

* bump version to 0.4.1

v0.4.0 Adds functionality to specify custom IDs

09 Nov 21:53
Compare
Choose a tag to compare

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.

First official release of Statsig Python SDK

09 Nov 21:50
427c69d
Compare
Choose a tag to compare

This SDK is for server side, multi-user environment usage. Check out our docs for details on how to use the SDK.