Lactuca Documentation#

Life actuarial calculations for Python — precise, fast, production-ready

Lactuca is a high-performance library for life actuarial calculations, consistent with international actuarial standards. It covers life contingencies, insurances, annuities, multiple-decrement models, and interest rate scenarios — vectorised with NumPy for production performance.

Quick Start

Get started with Lactuca in minutes. Load actuarial tables, calculate life annuities, and explore the core API.

Getting Started
User Guide

Step-by-step guides covering tables, calculation modes, interest rates, joint-life calculations, off-anniversary reserves, and more.

User Guide
AI Assistants

Context files and workflows for Cursor, Copilot, ChatGPT, and other AI tools.

Working with AI assistants
Cookbook

Copy-paste actuarial recipes for common valuation tasks.

Cookbook
Actuarial Formulas

Mathematical foundations and actuarial formulas used throughout the library, with LaTeX notation.

Actuarial Formulas
API Reference

Complete API documentation for all public classes, functions, and parameters.

API Reference

Features#

Tables

  • Aggregate, select-ultimate, static and generational tables — all major table structures supported

  • Ready-to-use bundled tables from Spain, Germany, Chile, USA, UK, Switzerland, and more — see the complete list

  • Generational mortality with exponential, linear, discrete, and projected improvement formulas

Calculations

  • Multiple-decrement models — life, disability, and exit tables combinable via table_combination

  • Annuities (discrete/continuous, immediate/due, fractional frequencies)

  • Life insurances (term, whole life, endowment)

  • Flexible interest rates with InterestRate (constant, piecewise, and named scenarios)

  • Growth rate scenarios with GrowthRate class for benefit escalation

  • Fractional time shifts (ts) with configurable integer-enforcement policy

  • Actuarial date utilities (exact age calculation, anniversary dates)

Platform

  • Highly optimised with NumPy vectorisation for production workloads

  • IDE-friendly: full autocompletion in Jupyter and VS Code via stub files (.pyi)

Indices#