Skip to main content
The guides use the latest Relativities API and require Python 3.12 or later. They assume familiarity with insurance rating and with Python and pandas.

Install Relativities

Create a virtual environment and install the package:
On macOS or Linux, activate it with source .venv/bin/activate. On Windows PowerShell, activate it with .venv\Scripts\Activate.ps1.
The package installs its matching rslc rating engine. Prebuilt wheels support macOS, Linux, and Windows.

Download the synthetic examples

Download the synthetic examples as examples.json in your working directory. Use your browser’s save command, or download the file from a terminal:
Unpack the examples in Python:
The download creates a folder named relativities-examples:
Run each guide from the directory containing this folder. Run its Python blocks in order in one notebook or Python session. For a guide that writes a bundle, start in a fresh working directory to keep output paths available. The RSL tutorial builds its own bundle from the source shown on the page. Other RSL guides use prepared bundles under relativities-examples/rsl/. The households, rating algorithms, and underwriting rules are synthetic. They illustrate analytical methods rather than real market premiums or carrier appetite. Local examples run with the downloaded files and the installed package.

Load a catalog rater

Catalog downloads require an Effective API key with access to the rater. Authentication explains how to obtain a key. Set it in the environment before starting Python:
In Windows PowerShell, use $env:EFFECTIVE_API_KEY = "sk-eai-...". Pass a catalog ID to Rater.load to download a rater. Pass a Path to load a local bundle. Rating runs on your machine; your submission data and results stay local. Catalog availability depends on your access and the published raters. The catalog identifiers shown in the guides illustrate the loading API. Use your available rater ID and pin its bundle revision for a reproducible study.