opendp 0.14.2-dev.20260401.2

A library of differential privacy algorithms for the statistical analysis of sensitive private data.
1
2
3
4
5
6
7
8
9
10
11
12
>>> dp.enable_features("contrib", "honest-but-curious")
>>> profile = dp.new_privacy_profile(lambda eps: 1.0 if eps < 0.5 else 1e-8)
...
>>> # epsilon is not enough, so delta saturates to one
>>> profile.delta(epsilon=0.499)
1.0
>>> # invert it, find the suitable epsilon at this delta
>>> profile.epsilon(delta=1e-8)
0.5
>>> # insufficient delta results in infinite epsilon
>>> profile.epsilon(delta=1e-9)
inf