Metrics Reference
philanthropy.metrics
Donor KPI calculators.
donor_retention_rate(current_donors, prior_donors)
Share of the prior period's donors who gave again this period.
Returns a fraction in [0.0, 1.0]; 0.0 when prior_donors is
empty (no base to retain from).
Source code in philanthropy/metrics/scoring.py
donor_acquisition_cost(total_fundraising_expense, new_donors_acquired)
Average spend to acquire one new donor.
Returns np.inf when new_donors_acquired is 0 (spend with nothing
acquired), so the result is always safe to compare or plot.
Source code in philanthropy/metrics/scoring.py
donor_lifetime_value(average_donation, lifespan_years, discount_rate=0.05, retention_rate=None)
Computes the Net Present Value (NPV) of a donor's future giving.
If a retention_rate is provided, the expected lifespan is dynamically computed as: expected_lifespan = 1 / (1 - retention_rate) Otherwise, the provided lifespan_years is used directly.
The mathematical formula for the NPV of an annuity is used:
If discount_rate > 0: NPV = average_donation * (1 - (1 + discount_rate) ** (-lifespan)) / discount_rate If discount_rate == 0: NPV = average_donation * lifespan
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
average_donation
|
float
|
The average annual donation amount. |
required |
lifespan_years
|
float
|
The fixed number of years the donor is expected to continue giving. Only used if retention_rate is None. |
required |
discount_rate
|
float
|
The discount rate used to compute the net present value of future gifts (e.g., 0.05 for 5%). |
0.05
|
retention_rate
|
float
|
The annual retention rate of the donor (e.g., 0.80 for 80%). If provided, this overrides lifespan_years by dynamically calculating expected lifespan. |
None
|
Returns:
| Type | Description |
|---|---|
float
|
The calculated Net Present Value of the expected donor lifetime value. |