Eppo SDK for Python
Maintained. Last release 11 months ago, commits in 1 of the last 26 weeks. Weaker on commit activity and release cadence.
pip install eppo-server-sdkEppo Python SDK
Eppo is a modular flagging and experimentation analysis tool. Eppo's Python SDK is built to make assignments in multi-user server side contexts. Before proceeding you'll need an Eppo account.
Features
- Feature gates
- Kill switches
- Progressive rollouts
- A/B/n experiments
- Mutually exclusive experiments (Layers)
- Holdouts
- Contextual multi-armed bandits
- Dynamic configuration
Installation
pip install eppo-server-sdk
Quick start
Begin by initializing a singleton instance of Eppo's client. Once initialized, the client can be used to make assignments anywhere in your app.
Initialize once
import eppo_client
from eppo_client import Config, AssignmentLogger
client_config = Config(
api_key="<SDK-KEY-FROM-DASHBOARD>", assignment_logger=AssignmentLogger()
)
eppo_client.init(client_config)
Assign anywhere
import eppo_client
client = eppo_client.get_instance()
user = get_current_user()
variation = client.get_boolean_assignment(
'show-new-feature',
user.id,
{ 'country': user.country },
False
)
Assignment functions
Every Eppo flag has a return type that is set once on creation in the dashboard. Once a flag is created, assignments in code should be made using the corresponding typed function:
get_boolean_assignment(...)
get_numeric_assignment(...)
get_integer_assignment(...)
get_string_assignment(...)
get_json_assignment(...)
Each function has the same signature, but returns the type in the function name. For booleans use get_boolean_assignment, which has the following signature:
get_boolean_assignment(
flag_key: str,
subject_key: str,
subject_attributes: Dict[str, Union[str, int, float, bool, None]],
default_value: bool
) -> bool:
Initialization options
The init function accepts the following optional configuration arguments.
| Option |
|---|