freshcrate
Home > Frameworks > statsig

statsig

Statsig Python Server SDK

Description

# Statsig Python Server SDK [![tests](https://github.com/statsig-io/python-sdk/actions/workflows/test.yml/badge.svg)](https://github.com/statsig-io/python-sdk/actions/workflows/test.yml) The python SDK for server/multi-user environments. Statsig helps you move faster with Feature Gates (Feature Flags) and Dynamic Configs. It also allows you to run A/B tests to validate your new features and understand their impact on your KPIs. If you're new to Statsig, create an account at [statsig.com](https://www.statsig.com). ## Getting Started Visit our [getting started guide](https://docs.statsig.com/server/pythonSDK). ## Testing Each server SDK is tested at multiple levels - from unit to integration and e2e tests. Our internal e2e test harness runs daily against each server SDK, while unit and integration tests can be seen in the respective github repos of each SDK. Run local unit tests separately for now: ``` python3 -m unittest tests/server_sdk_consistency_test.py python3 -m unittest tests/test_statsig_e2e.py ``` ## Guidelines - Pull requests are welcome! - If you encounter bugs, feel free to [file an issue](https://github.com/statsig-io/python-sdk/issues). - For integration questions/help, [join our slack community](https://join.slack.com/t/statsigcommunity/shared_invite/zt-pbp005hg-VFQOutZhMw5Vu9eWvCro9g).

Release History

VersionChangesUrgencyDate
0.71.6Imported from PyPI (0.71.6)Low4/21/2026
0.71.5 ### Fixes - Fix the default value for reuse connection pool for logEvent. >Included In This Release >- 6fbe68ea6697ba932da94d282a7021e89317b548 Weihao Ding > - fix: change reuse connection pool for logEvent default to be false (#522) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.71.4...0.71.5Low3/13/2026
0.71.4### New Features - new option to reuse the connection pool for logEvent >Included In This Release >- aa82bd97ea05c307400fc7bd9957fbc0d24d3857 Daniel > - revert 198efc51a18ecd91bdfc65cf55d2e57fc9b76a12 (#520) >- 47005cfb890acc8de3952e4dc16fa9369567984c Weihao Ding > - feat: add a option to control whether reuse connection pool for logevent (#519) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.71.3...0.71.4Low3/12/2026
0.71.3### Improvements - Add background config sync metric >Included In This Release >- afa1cc88ed0e006a4e0903f38a18b4e755584000 kat-statsig > - Hook up background sync telemetry metrics (#517) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.71.2...0.71.3Low3/11/2026
0.71.2### Improvements - Re-use connections for /sdk_exception logging >Included In This Release >- b1e4e9e6a6c3f16d033e14d8705f1499bf716b67 Daniel > - chore: use requests.Session for /sdk_exception (#515) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.71.1...0.71.2Low3/10/2026
0.71.1### Fixes - Remove hard dependency on specific httpx version >Included In This Release >- 35d394a8366cb961e60c31654530ae60f2c2a342 Daniel > - chore: remove hard dep of specific httpx version (#513) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.71.0...0.71.1Low3/9/2026
0.71.0### New Features - Adds IDList support to DataStore - (Experimental) Support HTTP2 >Included In This Release >- 198efc51a18ecd91bdfc65cf55d2e57fc9b76a12 Daniel > - feat(experimental): add http2 support via httpx module (#511) >- 6d4c987c5965bf7cdb90ea9edaa92b6f15fa1599 kat-statsig > - add metadata to ua (#508) >- 7270608f04bc327ae91b069e3021694435c5437a paul-statsig > - [datastore] support download id list in datastore (#506) **Full Changelog**: https://github.com/statsig-io/python-Low3/9/2026
0.70.5### Improvements - Support download id list file through statsig proxy ### Fixes - Patched unintentional reverts, restored network latency metric with new tags. >Included In This Release >- 5e2ba902dd9692547a0ac41608e128ed39512fe5 kat-statsig > - Add context tag to network latency metric (#504) >- 3dc8b90b302f7f4f5db6dbf12cfae6fbd9d8dde5 Daniel > - chore: address unintentional revert (#502) >- ed75666c69da4f57826fedf01f7107b25430cf75 Weihao Ding > - feat: support sfp download id lisLow3/4/2026
0.70.4 ### Improvements - Reduce the network requests made to CDN >Included In This Release >- 28a6f11fcf2a0666e786cc26396de49199b3c480 Daniel > - chore: reduce fallback to statsig network on bg sync (#498) >- d385c6431178e6ea9e4e93dad0924c560be9a229 Daniel > - Revert "Merge branch 'main' of https://github.com/statsig-io/private-python-sdk" >- 219c5b4b76a6ed314d977b1f51745bafd41cb471 Daniel > - Merge branch 'main' of https://github.com/statsig-io/private-python-sdk >- 6d2f951239529a1e75d13Low3/3/2026
0.70.3### New Features - Add two more tags into Init Metrics >Included In This Release >- 65f5af5a3d133af2d68b8e12812f98ddc41789e3 Weihao Ding > - Revert "feat: add sfp support for download single id list file" (#496) >- fef0d7c811284dfb17626717886cdfd46ab65372 Weihao Ding > - feat(ob): add more tags into init metric (#495) >- 6db9c5a2d952ba2423b92d41e88ca15fdf5bff23 Weihao Ding > - feat: add sfp support for download single id list file (#494) **Full Changelog**: https://github.com/statsiLow2/26/2026
0.70.2### Fixes - Send service name header broadly >Included In This Release >- 5e4c7fc0461d86e856d225689a13ca59fe527201 kat-statsig > - Send service header on all requests (#492) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.70.1...0.70.2Low2/20/2026
0.70.1### Improvements - Add id list file to metric tag >Included In This Release >- 061571324f64633f1aa2999782ff98ccce9afc4e kat-statsig > - id list file name tag (#490) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.70.0...0.70.1Low2/20/2026
0.70.0### New Features - Added id_lists_sync_overall.latency telemetry with reduced-cardinality tags: - id_list_manifest_success - succeed_single_id_list_number - Added network latency telemetry metrics (with request/result tagging) for better end-to-end observability. - Changed ID list downloads from concurrent to serial execution for safer/stabler processing. ### Fixes - Bumped protobuf dependency to 6.33.5. >Included In This Release >- 4dc9efa72a925d7a57f4c0fe5cLow2/18/2026
0.69.0### Improvements - new observability client metrics: - statsig.sdk.background_sync_duration_ms (distribution metric) -> tags: context, success, source, source_api, fallback_used - statsig.sdk.id_list_download (count metric) -> tags: success, source_api - added tags to statsig.sdk.initialization: added tags: id_list_count, init_source_api_id_lists >Included In This Release >- a5f4d18cd7aa2c78cfb60c89b5fce92df34e1e35 kat-statsig > Low2/9/2026
0.68.0### Improvements - send service name to statsig forward proxy in the header to improve observability on statsig forward proxy >Included In This Release >- 26a575b76676394f2fb3804e9de85a48eb2a63c5 kat-statsig > - Add service info (#479) >- d29460402c262ad3ad828477b8aa31a4a4bf0274 kat-statsig > - add service name (#478) >- 562e202a10864dfec8095894a12155a2d6aec66c kat-statsig > - bump requirement txt protobuf (#476) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.Low2/7/2026
0.67.0### New Features - Added Two new APIs that control DCS polling ``` def pause_polling_dcs(): """ Pauses background polling for Download Config Specs (DCS). """ __instance.pause_polling_dcs() ``` ``` def start_polling_dcs(): """ Resumes background polling for Download Config Specs (DCS). """ __instance.start_polling_dcs() ``` >Included In This Release >- 33f08004c1d5b17ed9192e7b02cc6d6889943c72 Weihao Ding > - feat: pause/start Low1/8/2026
0.66.2### Improvements - Decrease the chance that SDK faces peer cancellation error >Included In This Release >- ea4e2d0b34bdc3d994a7f77f3172123cdba5040b Xin Li > - update header across request session (#472) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.66.1...0.66.2Low12/12/2025
0.66.1### Fixes - Seeing increase ennconreset error for logevent since we refactor code to use request.session() instead of request. This is due to request.session() keep connection open by sending extra header Connection: keep-alive >Included In This Release >- 93cc104b1de844701e242c32751b77ba77545b9c Xin Li > - network: explicitly close connection for log event (#469) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.66.0...0.66.1Low10/29/2025
0.66.0 ### Fixes - Refactor the network to be: - If for a individual endpoint, e.g. log_event , dcs, authentication is required, create new HttpWorker which has request session authenticated. Leave other endpoint worker unauthenticated/ >Included In This Release >- dfac8a182da29f3a0a31dc39a02f6671c2a5039b Xin Li > - [refac]refactor http worker to support different session (#467) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.65.0...0.66.0Low10/16/2025
0.65.0 ### New Features - Switching from upper().lower() to casefold() for string comparison, reducing evaluation time >Included In This Release >- 6e10d5638b3fcadc362150199143d60c03ed153d kat-statsig > - merge Switch to casefold from upper lower (#465) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.64.0...0.65.0Low10/1/2025
0.64.0 ### New Features - support for target app condition in evaluation - support TLS/mTLS in http proxy >Included In This Release >- 1c0df4583001ccb0568d07066a945e85bd5028e0 kat-statsig > - add evaluation context and target app support (#462) >- f8c5a2575e2926a733c47521cafdead60f4b96fc paul-statsig > - support tls and mtls in http (#461) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.63.0...0.64.0Low9/9/2025
0.63.0 ### New Features - new option fields disable_ua_parser/disable_country_lookup to disable the loading of the libraries. This can save memory usage if none of the configs require user agent/ ip parsing >Included In This Release >- 5a0340e3593c892dd94467f977010417a4ec38e5 devin-ai-integration[bot] > - Add disable_ua_parser and disable_country_lookup options to reduce memory usage (#454) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.62.0...0.63.0Low8/14/2025
0.62.0 ### New Features - Support brotli and deflate compression for DCS ### Improvements - Improve initialization network (/dcs) reliability by removing sinceTime=0 >Included In This Release >- 79a41a5e44b6b1bbf06273e7cf1d41b3acc1ce8e Xin Li > - fix url for dcs fallback (#457) >- 90f455012f727989cd104ae2db1959e40c8803a3 Xin Li > - remove sinceTime=0 (#455) >- cc7289a753ee69ad6105d0dac1deef649082a2dd Daniel > - chore: enable brotli content decoding (#452) >- 12e2a599b7acfda7d520324Low8/14/2025
0.61.0 ### New Features - New option `global_custom_field` to add global fields to be used in evaluation >Included In This Release >- 317001af44e808f13261ba149922222de95fe639 kat-statsig > - add support for global custom fields (#449) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.60.0...0.61.0Low7/26/2025
0.60.0 ### Improvements - Change get_id_lists url - Error boundary timeout to respect options.timeout >Included In This Release >- 3c5f69bd50b2254d5054be193bb837a723005cf3 Xin Li > - eb set timeout to be options.timeout (#445) >- eb7a909cbd86501962fcf4bedfbbcd4c39448d36 kat-statsig > - move id list to cdn (#444) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.59.1...0.60.0Low7/18/2025
0.59.1 ### Improvements - Improves bad sdk key handling by not throwing and allowing any string when in local mode >Included In This Release >- 323e6d83ddac09afa49b1bb85075709c6c404304 sroyal-statsig > - Update Python Bad SDK Key Logic (#442) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.59.0...0.59.1Low7/16/2025
0.59.0 ### New Features - Support for release pipelines >Included In This Release >- 0598fa762b0c5f1e8522591a0d6b5e5539d9f6b9 kat-statsig > - add support for release pipeline evaluation (#437) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.58.4...0.59.0Low7/11/2025
0.58.4 ### Fixes - Bump ip3-country package dependency to include the fix on not releasing memory when CountryLookup is gc - Use request.session() for network requests >Included In This Release >- ae330f22136cd20cc9756a058be3655ae959d828 Xin Li > - Use requests.session instead of requests directly (#439) >- 608e9dc6525a5c63bb8b35c6ff97be56ecda99c8 Xin Li > - update ip3-country version (#438) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.58.3...0.58.4Low7/10/2025
0.58.3### Improvements - moved rulesets callback to after the store has completely finished parsing - security package updates ### Fixes - fix a bug where layers that depend on a gate may evaluate incorrectly under specific conditions. >Included In This Release >- 173cc2fd5310eceaad0b59468ef5a6b0552b79b2 kat-statsig > - move rulesets cb location (#435) >- b42e63c154d10aa38e69ddb648eb8924eb310429 kat-statsig > - bump protobuf (#434) >- 3cfe1dac02529af2428fa60af84f7ddLow6/17/2025
0.58.2 ### Improvements - removed grpc verbosity overwrite >Included In This Release >- f8ab33d47dd44e672ecd4b7d1896bd76d9edde5a kat-statsig > - remove default grpc verbosity to none (#430) >- f9eb65f546609117f2a38320a04d3cab9526c04e kat-statsig > - Bump setuptools (#429) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.58.1...0.58.2Low6/16/2025
0.58.1Fixes https://github.com/statsig-io/python-sdk/issues/29 >Included In This Release >- 293281771434d4b0cf7515efd57eff78e24ba242 tore-statsig > - fix: set accept-encoding header (#425) >- 1cd185c94f249c29ac7fcd028f9583066794c4dc dependabot[bot] > - Bump setuptools from 70.0.0 to 78.1.1 (#424) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.58.0...0.58.1Low6/4/2025
0.58.0 ### New Features - Adds support for including session replay info in get client initialize response >Included In This Release >- c04bef329bdbeceed9efc0d12720f54d910c30fd sroyal-statsig > - Add Session Replay Info to GCIR (#422) >- 17d44b878b96306f1f2a30930f383f1d4537e7b8 dependabot[bot] > - Bump setuptools from 65.5.1 to 70.0.0 (#421) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.57.3...0.58.0Low5/20/2025
0.57.3 ### New Features - Expose grpc metrics ### Fixes - Fix behavior that when grpc is reconnected to SFP, we sometimes don't cancel background polling job >Included In This Release >- cb2d9e5d1c75d978d80ce23bb2cb20d3b5ea7b3a kat-statsig > - grpc ob (#419) >- b5f257366bb8375c650b0dc5b540e00c7bbd9e90 kat-statsig > - move fallback class (#418) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.57.2...0.57.3Low4/11/2025
0.57.2 ### Fixes - Fixed a bug where the sdk fail to initialize if there are multiple unsupported config operator/conditions >Included In This Release >- d66ea5b5917bef6db1962c16dbb78f8f7795c861 kat-statsig > - pre parse edge case patch (#415) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.57.1...0.57.2Low4/3/2025
0.57.1 ### Fixes - patch an edge case where secondary exposures may be sampled if primary exposure falls through to default >Included In This Release >- 91fd291c9f4450b2ece367be54a012a24869fa2f kat-statsig > - fix sampling (#413) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.57.0...0.57.1Low3/4/2025
0.57.0 ### Improvements - export public objects for better linter experience - add id type to evaluation result ### Fixes - add typing_extensions to set up requirement >Included In This Release >- 970ce9d3da09cd2aa95eb173500ce333fd364cf5 kat-statsig > - export all pubic objects (#411) >- 23afb733ab7cd6cfd30151e3d58b601ebbbc031b kat-statsig > - add typing extension to setup requirement (#409) >- 100092133e796b5d24f5ed39945e5d009ae2a5af Weihao Ding > - fix: id_type to idType (#408) >Low2/28/2025
0.56.0 ### New Features - new option for events flushed callback >Included In This Release >- 6447d33c31415f23b50504b2eea78a3e711399f6 kat-statsig > - events flushed callback (#403) >- fa077e311429308bd629709f4f4888164d6f80f5 Weihao Ding > - chore: Update kong.yml (#404) >- b74a0ae83f6fa94dc0ebbf41c86f0fcca1e29a25 Xin Li > - Update LRS.yml (#402) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.55.3...0.56.0Low2/12/2025
0.55.3 ### Fixes - Use TypeAlias for JSONValue type to avoid recursion error when used with pydantic >Included In This Release >- 2e21bc6fc0caadba03d4eca1a7d4f90c4ecb5c75 kat-statsig > - typing alias (#399) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.55.2...0.55.3Low2/4/2025
0.55.2 ### Improvements - Add passed field to get client initialize response for dynamic configs >Included In This Release >- acafc85ae5c498d0325e9beedc1ced7aa038b725 sroyal-statsig > - Add DC Passed to GCIR (#398) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.55.1...0.55.2Low1/31/2025
0.55.1 ### Fixes - republish python with wheel >Included In This Release **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.55.0...0.55.1Low1/22/2025
0.55.0 ### New Features - statsig is now published as a wheel as well as the source code on pypi ### Improvements - unit test improvement - typing changes >Included In This Release >- 9af94f24ccdeb7bee72a6fe82a9da95fbb1a2320 kat-statsig > - unflakey the sampling test (#394) >- 3d40456bb88612d5afed5e86f681fe3d8433d2f0 kat-statsig > - use mapping for json types (#392) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.54.0...0.55.0Low1/22/2025
0.54.0 ### New Features - added sdk_error_callback option to listen for unexpected exceptions caught - new metrics *sdk_exceptions_count* + *events_successfully_sent* ### Improvements - stricter typing on statsig user to only allow JSON serializable type - check user for any UA fields before using UA >Included In This Release >- cd1d72332e7ee67d491b60e5a287d5de3d2b13e2 kat-statsig > - error handling update (#389) >- 708d00131a7e9a89b1d9ec0869e4b87775d73497 sroyal-stLow1/16/2025
0.53.0 ### Improvements - refactored network request to consolidate exception paths ### Fixes - fix a bug in network fallback unit test where status code was not reset between tests, causing the unit test to be inaccurate >Included In This Release >- 4c4efade3f52d0c30050c02cf01941c093e42112 kat-statsig > - return unsuccess for local mode (#386) >- b319918b3fe3bec897db7082b39c635245d63263 kat-statsig > - network request + unit test refactor (#384) **Full Changelog**: https://github.comLow1/8/2025
0.52.0 ### Improvements - added capability to sample manual exposures ### Fixes - fix a bug where config sync can be stuck in no update state if network request succeeds but fails to parse >Included In This Release >- c70b591f497c63fdd8c81c3bbcccbe1380db2c2f kat-statsig > - fix no update bug (#382) >- bdfdce41262d7b7ac5315f9849ff8a085066ab60 kat-statsig > - manual exposure sample (#381) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.51.0...0.52.0Low1/6/2025
0.51.0 ### Improvements - Reduce memory usage when downloading config specs >Included In This Release >- 54607e47b4521cdc3882ca9b151b348d424dfa20 kat-statsig > - stream response (#379) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.50.1...0.51.0Low12/13/2024
0.50.1### Improvements - Down-grade some log levels >Included In This Release >- 19bfea9416e5a0f63e1a8550d8bae0afb0edb97b Xin Li > - update (#377) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.50.0...0.50.1Low12/12/2024
0.50.0 ### Improvements - avoid unnecessary config copies to improve memory usage - check status code before throwing seek range error >Included In This Release >- 950c98f29a72786fcd65d122776467cfa6806e02 kat-statsig > - Only perform copy when necessary (#374) >- d9cffe5d98868369f7f40ac184f45c1ad5044e3d kat-statsig > - seek range fix (#372) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.49.0...0.50.0Low12/3/2024
0.49.0 ### New Features - new option observability_client for metrics collection - new option overall_init_timeout for timing entire sdk initialization ### Improvements - now log data source url -⚠️ added support for default environment tier, highly recommend to set environment tier within statsigOptions if possible - If statsig environment.tier is not being set, then we will use fallback to set environment for evaluation as - SDK key environment tier if being set Low11/12/2024
0.48.0 ### New Features - Initialize now return initializationDetails which has information on data source, is initialize successful, is the store populate, duration and error ### Improvements - remove noisy logging ### Fixes - fix a bug where fallback behavioral is triggered for id list no matter the option >Included In This Release >- 76e1279a8290fc934b8804a9b4438a9ba02ef3aa kat-statsig > - Some bug fixes (#359) >- 50910bbd7416dc6303efd6f0fe88ae2655df8c29 kat-statsig > - Add IniLow10/18/2024
0.47.2 ### Fixes - fix a bug with typing to allow float type for statsig event value >Included In This Release >- ae944c40301b7cbed02b05fe30a6d7360d375983 kat-statsig > - add float type to statsig event value (#355) **Full Changelog**: https://github.com/statsig-io/python-sdk/compare/0.47.1...0.47.2Low10/16/2024

Dependencies & License Audit

Loading dependencies...

Similar Packages

pre-commitA framework for managing and maintaining multi-language pre-commit hooks.v4.6.0
azure-core-tracing-opentelemetryMicrosoft Azure Azure Core OpenTelemetry plugin Library for Pythonazure-template_0.1.0b6187637
spdx-toolsSPDX parser and tools.0.8.5
lacesDjango components that know how to render themselves.0.1.2
django-tasksA backport of Django's built in Tasks framework0.12.0