-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.txt
46 lines (38 loc) · 1.16 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Simple but flexible python library for A/B or split testing.
================
Examples
================
1. SimpleAB test. This implementation of AB Test provides way to implement
alternatives as methods with names A, B, ..., Z.
>>> import simpleab
>>> class MyTest(simpleab.SimpleAB):
... name = 'MyTest'
... def A(self): return 'Side A'
... def B(self): return 'Side B'
... def C(self): return 'Side C'
...
>>> myab = MyTest()
>>> myab.test()
'Side A'
>>> myab.current_side
'A'
>>> myab.test(force_side='C')
'Side C'
2. ConfigurableAB test. This implementation of AB Test provides way to configure
test name, sides and selector instance. If selector isn't specified random selection
will be used.
>>> improt simpleab
>>> import random
>>> myab = simpleab.ConfigurableAB(name='MyTest',
... sides={'A': 'Side A', 'B': 'Side B'},
... selector=lambda: random.choice(['A','B']))
>>> myab
<ConfigurableAB [name: MyTest, sides: ['A', 'B']]>
>>> myab.test()
'Side A'
>>> myab.current_side
'A'
3. Super short version, quick AB test:
>>> improt simpleab
>>> simpleab.quick_test('MyTest', sides={'A': 'Side A', 'B': 'Side B'})
'Side B'