Metadata-Version: 2.1
Name: outplan
Version: 3.0.0
Summary: Support nested experiment/namespace base on Facebook Planout
Author-email: x1ah <gaoxiaoqiang@xiachufang.com>
License: MIT License
        
        Copyright (c) 2019 xiachufang
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Repository, https://github.com/xiachufang/outplan
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: Chinese (Simplified)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: planout ==0.6.0
Requires-Dist: six
Requires-Dist: typing-extensions
Provides-Extra: test
Requires-Dist: pytest ; extra == 'test'
Requires-Dist: gevent ; extra == 'test'

# outplan

[![Build Status](https://travis-ci.com/xiachufang/outplan.svg?branch=master)](https://travis-ci.com/xiachufang/outplan) ![GitHub](https://img.shields.io/github/license/xiachufang/outplan)

Support nested experiment/namespace base on [PlanOut](https://github.com/facebook/planout)

# Install
```python
pip install outplan
```

# Usage

```python
from outplan import NamespaceItem, ExperimentItem, GroupItem, ExperimentGroupClient

SimpleNamespace = NamespaceItem(
    name="namespace_1",
    bucket=10,
    experiment_items=[
        ExperimentItem(
            name="exp_1",
            bucket=10,
            group_items=[
                GroupItem(name="a", weight=0.5),
                GroupItem(name="b", weight=0.5),
            ]
        ),
    ]
)

client = ExperimentGroupClient([SimpleNamespace])

print(client.get_group("namespace_1", unit="your_unit"))


# nested experiment/namespace is defined at `tests/test_experiment.py`
```

# Dev

```shell
# install deps (once)
pip install -e .[test]

# run test
make test

# commit
pip install pre-commit
# and commit here
```
