https://github.com/jkoestner/morai
Actuarial experience dashboard and predictor
https://github.com/jkoestner/morai
actuarial actuary mortality plotly python
Last synced: about 2 months ago
JSON representation
Actuarial experience dashboard and predictor
- Host: GitHub
- URL: https://github.com/jkoestner/morai
- Owner: jkoestner
- License: mit
- Created: 2024-02-07T05:01:42.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2026-04-20T04:07:48.000Z (about 2 months ago)
- Last Synced: 2026-04-20T05:35:46.439Z (about 2 months ago)
- Topics: actuarial, actuary, mortality, plotly, python
- Language: Python
- Homepage:
- Size: 119 MB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README

# Morai

[](https://github.com/jkoestner/morai/blob/main/LICENSE.md)
[](https://codecov.io/gh/jkoestner/morai)
[](https://github.com/astral-sh/ruff)

## Table of Contents
- [Morai](#morai)
- [Table of Contents](#table-of-contents)
- [Overview](#overview)
- [Installation](#installation)
- [Local Install](#local-install)
- [Docker Install](#docker-install)
- [Usage](#usage)
- [CLI](#cli)
- [Other Tools](#other-tools)
- [Jupyter Lab Usage](#jupyter-lab-usage)
- [Logging](#logging)
- [Coverage](#coverage)
## Overview
**📖 Description:**
[Moirai](https://en.wikipedia.org/wiki/Moirai#:~:text=In%20ancient%20Greek%20religion%20and,Moirai)
in greek mythology are known as the fates. They are personifications of destiny.
The name Morai was chosen as the package is designed to help actuaries review
mortality and experience data.
**📊 Dashboard:**
- [Dashboard](https://morai.koestner.fun)
- Data Overview: 
- Data Tables: 
- Data CDC: 
**🔬 Jupyter Notebook:**
- [Data Process](http://githubtocolab.com/jkoestner/morai/blob/main/notebooks/01.data_process.ipynb)
- [Exploratory](http://githubtocolab.com/jkoestner/morai/blob/main/notebooks/02.exploratory.ipynb)
- [Predictive Models](http://githubtocolab.com/jkoestner/morai/blob/main/notebooks/06.1.predictive_model.ipynb)
- And Others
## Installation
### Install
To install the base package
```
uv pip install morai
```
To install optional dependencies
```
uv pip install morai[dev][neural][r]
```
### Local Install
To install, download this repository and run the following command in
the environment of choice. Optional dependencies can be installed by adding
`[dev][neural][r]` to the end of the command.
```
uv pip install -e .
```
### Docker Install
The package can also be run in docker which provides a containerized environment, hosting the web dashboard.
```bash
version: "3.8"
services:
morai:
image: dmbymdt/morai:latest
container_name: morai
command: gunicorn -b 0.0.0.0:8001 morai.dashboard.app:server
restart: unless-stopped
environment:
MORAI_FILES_PATH: /code/morai/files # setting the files path for morai
ports:
- '8001:8001'
volumes:
- $DOCKERDIR/morai/files:/code/morai/files # mounting the files directory
```
## Usage
### CLI
CLI can be used for easier commands of python scripts for both portfolio or manager. An example of a CLI command is shown below. When running the dashboard the `MORAI_FILES_PATH` environment variable needs to be set to the directory where the files are stored.
```commandline
morai dashboard
```
It also can be run locally by running below in the root directory of the repository.
```python
python -m morai.dashboard.app
```
## Other Tools
### Jupyter Lab Usage
To have conda environments work with Jupyter Notebooks a kernel needs to be defined. This can be done defining a kernel, shown below when
in the conda environment.
```
python -m ipykernel install --user --name=morai
```
If plotly images are not showing in the default set up there may need to be some extensions added to JupyterLab.
The extension particularly needed is the jupyterlab-plotly extension.
This is also discussed more in this issue: [Plotly Issue](https://github.com/plotly/plotly.py/issues/2672)
### Logging
If wanting to get more detail in output of messages the logging can increased
```python
from morai.utils import custom_logger
custom_logger.set_log_level("DEBUG")
```
### Coverage
To see the test coverage the following command is run in the root directory.
```
pytest --cov=morai --cov-report=html
```
To test static typing
```
mypy morai
```