Python tools for actuarial analysis.
Project description
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
pip install actuarialpy
Usage
from actuarialpy import loss_ratio
lr = loss_ratio(expenses=850_000, revenue=1_000_000)
print(lr)
# 0.85
Loss ratio
loss_ratio(expenses, revenue)
Calculates:
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:
pip install -e .
Run tests:
pip install pytest
pytest
Build for PyPI:
python -m pip install --upgrade build twine
python -m build
twine check dist/*
twine upload dist/*
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file actuarialpy-0.1.0.tar.gz.
File metadata
- Download URL: actuarialpy-0.1.0.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc7b138dd33dbeb325ce86b671af594e337dfe1ca781b80b6f23b7a9771a5f1e
|
|
| MD5 |
a49a749007e3f2374f598be684c505b0
|
|
| BLAKE2b-256 |
34da749e1eb2ac687a772c65a8093499cdf04387e75a08e7d19768e5b071c740
|
File details
Details for the file actuarialpy-0.1.0-py3-none-any.whl.
File metadata
- Download URL: actuarialpy-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6bedecb58fca69ec1cccc30e5da99338fd1b804a661c285b7f93d14be224af4
|
|
| MD5 |
9526f3258965302f994d68e9236fd16d
|
|
| BLAKE2b-256 |
1c770de9b25c2422dc4e3c5da53186bdfc8ad668e5ea46edc00e971ee0800e3d
|