Skip to main content

A mortality viewer

Project description


Morai

workflow badge license badge codecov Code style: black Python

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: dash_data_input
  • Data Tables: dash_data_tables
  • Data CDC: dash_cdc

🔬 Jupyter Notebook:

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

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

morai-0.3.2.tar.gz (787.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

morai-0.3.2-py3-none-any.whl (780.3 kB view details)

Uploaded Python 3

File details

Details for the file morai-0.3.2.tar.gz.

File metadata

  • Download URL: morai-0.3.2.tar.gz
  • Upload date:
  • Size: 787.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for morai-0.3.2.tar.gz
Algorithm Hash digest
SHA256 938fa2362a39ead9880873e8fca9b03bafe47f5b2b4c0d1e0c3a67aabac253ed
MD5 af36b3b627327a656945e9231c104942
BLAKE2b-256 421a0d9b4b683f10711efb1097cbb3a3a2098dd963a6ae146e1a5f66ac236a19

See more details on using hashes here.

File details

Details for the file morai-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: morai-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 780.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for morai-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ce5ec606d7630628487667dc1dda164eff82801c2a6eb9db2d8888a55a624f2a
MD5 bdd293578d9194701457d4c8e1e1e276
BLAKE2b-256 b6c170492ae0b82eae73e293c74c474dd2f7bf6b4464929450aa2d7c18f32ebe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page