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-clientVerified import paths — ran on the pinned version, not inferred.
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.
Call `factory.block_until_ready(timeout_seconds)` after `get_factory()` and handle `TimeoutException`.
Upgrade Python to 3.7.16 or later if using `asyncio` features. Ensure `get_factory_async` is used for async initialization.
Remove `redisErrors` from your SDK configuration if present. Refer to `redis-py` documentation for equivalent error handling if needed.
Ensure `factory.destroy()` is called only during application shutdown. Do not use the client object after the factory has been destroyed.
Upgrade to `splitio-client` v10.4.0 or later to correctly evaluate rule-based segments.
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'`.
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.
Provide a valid, non-empty SDK API key from your Split.io account. Ensure environment variables or configuration files are correctly populated.