Metadata-Version: 2.4
Name: shapleyrs
Version: 0.1.0
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: pytest ; extra == 'tests'
Provides-Extra: tests
Summary: A fast shapley score calculator
Keywords: GameTheory,Shapley
Author: Mathew Shen <datahonor@gmail.com>
Author-email: Mathew Shen <datahonor@gmail.com>
License: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Source Code, https://github.com/shenxiangzhuang/shapley

# Shapley


[![PyPI - Version](https://img.shields.io/pypi/v/shapleyrs)](https://pypi.org/project/shapleyrs/)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)


[`shapley`](https://github.com/shenxiangzhuang/shapley)
is a fast Shapley value calculator written in rust.


## Quick Start

### Install

```bash
pip install shapleyrs
```


### Usage

```python
from shapleyrs import Shapley

shapley = Shapley(players=[1, 2], coalition_worth={
    (): 0,
    (1,): 10,
    (2,): 20,
    (1, 2): 30,
})

print(shapley.shapley_value(1)) # 10
print(shapley.shapley_value(2)) # 20
```

