Registry / devops / splitio-client

splitio-client

JSON →
library10.6.0pypypi✓ verified 84d ago

Split.io Python Client (splitio-client) is the official Python SDK for the Split Feature Delivery Platform. It enables developers to implement feature flags, conduct controlled rollouts, and perform data-driven experiments to manage the customer experience. The library is actively maintained by Split (now part of Harness) with frequent updates that include bug fixes and new feature support, such as rule-based segments and feature flag prerequisites. It is compatible with Python 3.7 and higher.

pip install splitio-client
INSTALL
IMPORT
SIG · SPLITIO-CLIENT
S
splitio-client
devopspythonv10.6.0
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v10.6.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
4/8 runs
4/8 runs
py 3.11
4/8 runs
4/8 runs
py 3.12
4/8 runs
4/8 runs
py 3.13
4/8 runs
4/8 runs
py 3.9
4/8 runs
4/8 runs
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

get_factory
from splitio import get_factory
TimeoutException
from splitio.exceptions import TimeoutException
get_factory_async
from splitio import get_factory_async
For asynchronous (asyncio) factory initialization.

This quickstart demonstrates how to initialize the Split.io Python SDK, wait for it to be ready, and retrieve a treatment for a specific feature flag and user key. It also includes basic error handling for timeouts and ensures proper shutdown of the SDK factory.

import os from splitio import get_factory from splitio.exceptions import TimeoutException # Get your SDK API key from environment variables for security SPLIT_API_KEY = os.environ.get('SPLIT_SDK_API_KEY', 'YOUR_SDK_TYPE_API_KEY') CUSTOMER_ID = 'test_user_123' FEATURE_FLAG_NAME = 'my_new_feature' # Initialize the Split factory # For production, ensure config is properly set up, e.g., for logging, storage, etc. factory = get_factory(SPLIT_API_KEY) try: # Wait up to 5 seconds for the SDK to be ready and download definitions factory.block_until_ready(5) split_client = factory.client() # Get treatment for the customer treatment = split_client.get_treatment(CUSTOMER_ID, FEATURE_FLAG_NAME) if treatment == 'on': print(f"Feature '{FEATURE_FLAG_NAME}' is ON for user '{CUSTOMER_ID}'.") # Code to show 'on' treatment elif treatment == 'off': print(f"Feature '{FEATURE_FLAG_NAME}' is OFF for user '{CUSTOMER_ID}'.") # Code to show 'off' treatment else: # 'control' or any other undefined treatment print(f"Feature '{FEATURE_FLAG_NAME}' is in CONTROL for user '{CUSTOMER_ID}'.") # Code for default/control treatment except TimeoutException: print("Split SDK timed out while initializing. Falling back to control.") # Handle timeout gracefully, e.g., log and proceed with default experience except Exception as e: print(f"An error occurred: {e}") finally: # It's important to destroy the factory when the application shuts down # to ensure all queued impressions/events are sent and resources are released. factory.destroy()
Debug
Known issues
gotchaThe SDK might return 'control' for treatments if it's not fully initialized or if a feature flag is not found. Always use `factory.block_until_ready()` with a timeout to ensure data is loaded before evaluation.
fix
Call `factory.block_until_ready(timeout_seconds)` after `get_factory()` and handle `TimeoutException`.
affects: All versions
breakingAsynchronous (asyncio) support was introduced in v10.0.0 and requires Python 3.7.16 or later. Previous Python 3.x versions might experience issues with asyncio-specific functionalities.
fix
Upgrade Python to 3.7.16 or later if using `asyncio` features. Ensure `get_factory_async` is used for async initialization.
affects: >=10.0.0
deprecatedThe configuration parameter `redisErrors` was deprecated in v10.5.0 as it was removed from the underlying `redis-py` library since v6.0.0.
fix
Remove `redisErrors` from your SDK configuration if present. Refer to `redis-py` documentation for equivalent error handling if needed.
affects: >=10.5.0
gotchaUsing the client after calling `factory.destroy()` will result in 'Client has already been destroyed' errors, and all `getTreatment` calls will return 'control' or map of controls.
fix
Ensure `factory.destroy()` is called only during application shutdown. Do not use the client object after the factory has been destroyed.
affects: All versions
gotchaRule-based segments are only fully supported from SDK versions 10.4.0 and above. Older SDK versions will return the 'control' treatment for flags configured with rule-based segments and log a specific impression label.
fix
Upgrade to `splitio-client` v10.4.0 or later to correctly evaluate rule-based segments.
affects: <10.4.0
Errors
Common errors & fixes
TypeError: type() argument 1 must be string, not unicode
This error typically occurs in older Python 2.7 environments due to issues with the `enum34` dependency being an outdated version.
fix
While `splitio-client` primarily supports Python 3.7+, if encountered in a constrained Python 2.7 environment, ensure `enum34` is version 1.1.5 or above: `pip install 'enum34>=1.1.5'`.
pip install 'splitio-client[cpphash]' fails with 'command 'g++' failed with exit status 1' on macOS
This is often due to an outdated or incompatible C++ compiler (g++) or issues with `libstdc++` on older macOS versions (e.g., Mojave) when building the `splitmmh3` dependency.
fix
Try `pip install splitio-client` without the `[cpphash]` extra, as the pure Python hashing implementation might work. Alternatively, update your Xcode Command Line Tools or try a different Python environment manager (like Conda) that provides its own compiler toolchain.
factory instantiation: you passed an empty api_key, api_key must be a non-empty string.
The SDK was initialized with an empty or `None` API key string.
fix
Provide a valid, non-empty SDK API key from your Split.io account. Ensure environment variables or configuration files are correctly populated.
Upgrade
Version history
10.6.0latest on PyPI · released Jan 28, 2026
Audit
Dependencies
redisoptionalRequired if using the Redis storage backend for multi-process environments.
Agent activity
17 hits · last 30 days
node
16
OpenAI (training)
1
Resources
splitio-client — pip install splitio-client · libregistry