Quickstart#
The easiest way to get started with OpenDP is from Python.
Use pip
to install the opendp package from PyPI.
pip install opendp
This will make the OpenDP modules available to your local environment.
The vetting process is currently underway for the code in the OpenDP Library.
Any code that has not completed the vetting process is marked as “contrib” and will not run unless you opt-in.
Enable contrib
globally with the following snippet:
>>> from opendp.mod import enable_features
>>> enable_features('contrib')
Hello, OpenDP!#
Once you’ve installed OpenDP, you can write your first program.
In the example below, we’ll construct a clamp opendp.mod.Transformation
, then invoke it on a dataset of strings.
>>> from opendp.transformations import make_clamp
...
>>> clamp = make_clamp(bounds=(0, 10))
>>> clamp([-1, 5, 12, -2])
[0, 5, 10, 0]
If you would like to skip directly to a more complete example, see Putting It Together.
Otherwise, continue on to the User Guide.