Metadata-Version: 2.4
Name: actuarialpy
Version: 0.1.0
Summary: Python tools for actuarial analysis.
Project-URL: Homepage, https://github.com/actuarialpy/actuarialpy-core
Project-URL: Repository, https://github.com/actuarialpy/actuarialpy-core
Project-URL: Issues, https://github.com/actuarialpy/actuarialpy-core/issues
Author: Michael Bryant
License-Expression: MIT
License-File: LICENSE
Keywords: actuarial,analytics,insurance,loss ratio,risk
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
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: Topic :: Office/Business :: Financial
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Python: >=3.9
Requires-Dist: numpy>=1.23
Description-Content-Type: text/markdown

# ActuarialPy

**ActuarialPy** is a Python package for general actuarial analysis.

The initial version includes a basic loss ratio calculation. Future modules may include experience summaries, trend tools, actual-to-expected analysis, exposure-based metrics, validation, and reporting.

## Installation

```bash
pip install actuarialpy
```

## Usage

```python
from actuarialpy import loss_ratio

lr = loss_ratio(expenses=850_000, revenue=1_000_000)

print(lr)
# 0.85
```

## Loss ratio

```python
loss_ratio(expenses, revenue)
```

Calculates:

```text
loss ratio = expenses / revenue
```

Examples of use:

- health MLR: claims / premium
- P&C loss ratio: losses / earned premium
- combined-style ratios: losses plus expenses / revenue, if expenses are pre-summed before calling the function

## Development

Install locally in editable mode:

```bash
pip install -e .
```

Run tests:

```bash
pip install pytest
pytest
```

Build for PyPI:

```bash
python -m pip install --upgrade build twine
python -m build
twine check dist/*
twine upload dist/*
```
