A mortality viewer
Project description
Morai
Table of Contents
Overview
📖 Description:
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
- Data Overview:
- Data Tables:
- Data CDC:
🔬 Jupyter Notebook:
- Data Process
- Exploratory
- Predictive Models
- 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.
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.
morai dashboard
It also can be run locally by running below in the root directory of the repository.
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
Logging
If wanting to get more detail in output of messages the logging can increased
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
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 morai-0.3.4.tar.gz.
File metadata
- Download URL: morai-0.3.4.tar.gz
- Upload date:
- Size: 802.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a4966316027009de4cbf8baefe7be7e9b0d1ef1facca6506970fa52becb9854
|
|
| MD5 |
8b2040ae9a0fbc1766a6a4625f9de9d8
|
|
| BLAKE2b-256 |
d6b79382126f53698974ff37a8fcbb956988aaa9deaf2d6c9c3981aac1a96212
|
File details
Details for the file morai-0.3.4-py3-none-any.whl.
File metadata
- Download URL: morai-0.3.4-py3-none-any.whl
- Upload date:
- Size: 792.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d83ce54c53f9f9fad2890259610829810d360c80371a7159f0e81a50ffbf562c
|
|
| MD5 |
c68a2c88bbc7bf7b3c691b60c9f66d6c
|
|
| BLAKE2b-256 |
499baa7a875dce570672cc42a2fdb1837e4975ac3410b31103b50bd0034595c0
|