> ## Documentation Index
> Fetch the complete documentation index at: https://docs.canary.effectiveai.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Install and prepare the examples

> Install Relativities, download the synthetic rating examples, and prepare a working directory for the guides.

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:

```sh theme={null}
python -m venv .venv
```

On macOS or Linux, activate it with `source .venv/bin/activate`.
On Windows PowerShell, activate it with `.venv\Scripts\Activate.ps1`.

```sh theme={null}
python -m pip install "relativities>=0.4,<0.5"
```

The package installs its matching `rslc` rating engine. Prebuilt wheels support macOS, Linux, and Windows.

## Download the synthetic examples

Download the [synthetic examples](/relativities/examples.json) as `examples.json` in your working directory.
Use your browser's save command, or download the file from a terminal:

```sh theme={null}
curl --location --output examples.json https://docs.canary.effectiveai.app/relativities/examples.json
```

Unpack the examples in Python:

```python theme={null}
import base64
import io
import json
from pathlib import Path
from zipfile import ZipFile

sample = json.loads(Path("examples.json").read_text(encoding="utf-8"))
with ZipFile(io.BytesIO(base64.b64decode(sample["archive"]))) as archive:
    archive.extractall(".")
```

The download creates a folder named `relativities-examples`:

```text theme={null}
relativities-examples/
  example-auto.zip          # one synthetic auto rater
  table-rater.zip           # a synthetic rater with an editable rating table
  ppa/
    book/                  # six households in five CSV tables
    carrier-a.zip          # liability and collision; six-month premiums
    carrier-b.zip          # account premiums; twelve-month term
    carrier-a.rsl          # synthetic source used by the packaging guide
    program_a/             # prepare, its schema, and expected results
  rsl/                     # synthetic source and prepared bundles for the RSL guides
  LICENSE
  README.md
```

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](/getting-started/authentication) explains how to obtain a key.
Set it in the environment before starting Python:

```sh theme={null}
export EFFECTIVE_API_KEY=sk-eai-...
```

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.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.