This documentation is for an old version of OpenDP.

The current release of OpenDP is v0.11.1.

opendp.core module#

opendp.core.measurement_check(measurement, d_in, d_out)[source]#

Check the privacy relation of the measurement at the given d_in, d_out.

Parameters:
  • measurement (Measurement) – Measurement to check the privacy relation of.

  • d_in (Any) – Distance in terms of the input metric.

  • d_out (Any) – Distance in terms of the output measure.

Returns:

True indicates that the relation passed at the given distance.

Return type:

bool

Raises:
  • AssertionError – if an argument’s type differs from the expected type

  • UnknownTypeError – if a type-argument fails to parse

  • OpenDPException – packaged error from the core OpenDP library

opendp.core.measurement_input_carrier_type(measurement)[source]#

Get the input (carrier) data type of measurement.

Parameters:

measurement (Measurement) – The measurement to retrieve the type from.

Return type:

str

Raises:
  • AssertionError – if an argument’s type differs from the expected type

  • UnknownTypeError – if a type-argument fails to parse

  • OpenDPException – packaged error from the core OpenDP library

opendp.core.measurement_input_distance_type(measurement)[source]#

Get the input distance type of measurement.

Parameters:

measurement (Measurement) – The measurement to retrieve the type from.

Return type:

str

Raises:
  • AssertionError – if an argument’s type differs from the expected type

  • UnknownTypeError – if a type-argument fails to parse

  • OpenDPException – packaged error from the core OpenDP library

opendp.core.measurement_invoke(measurement, arg)[source]#

Invoke the measurement with arg. Returns a differentially private release.

Parameters:
  • measurement (Measurement) – Measurement to invoke.

  • arg (Any) – Input data to supply to the measurement. A member of the measurement’s input domain.

Returns:

Differentially private release.

Return type:

Any

Raises:
  • AssertionError – if an argument’s type differs from the expected type

  • UnknownTypeError – if a type-argument fails to parse

  • OpenDPException – packaged error from the core OpenDP library

opendp.core.measurement_output_distance_type(measurement)[source]#

Get the output distance type of measurement.

Parameters:

measurement (Measurement) – The measurement to retrieve the type from.

Return type:

str

Raises:
  • AssertionError – if an argument’s type differs from the expected type

  • UnknownTypeError – if a type-argument fails to parse

  • OpenDPException – packaged error from the core OpenDP library

opendp.core.transformation_check(transformation, d_in, d_out)[source]#

Check the stability relation of the transformation at the given d_in, d_out.

Parameters:
  • transformation (Transformation) – Transformation to check the stability relation of.

  • d_in (Any) – Distance in terms of the input metric.

  • d_out (Any) – Distance in terms of the output metric.

Returns:

True indicates that the relation passed at the given distance.

Return type:

bool

Raises:
  • AssertionError – if an argument’s type differs from the expected type

  • UnknownTypeError – if a type-argument fails to parse

  • OpenDPException – packaged error from the core OpenDP library

opendp.core.transformation_input_carrier_type(transformation)[source]#

Get the input (carrier) data type of transformation.

Parameters:

transformation (Transformation) – The transformation to retrieve the type from.

Return type:

str

Raises:
  • AssertionError – if an argument’s type differs from the expected type

  • UnknownTypeError – if a type-argument fails to parse

  • OpenDPException – packaged error from the core OpenDP library

opendp.core.transformation_input_distance_type(transformation)[source]#

Get the input distance type of transformation.

Parameters:

transformation (Transformation) – The transformation to retrieve the type from.

Return type:

str

Raises:
  • AssertionError – if an argument’s type differs from the expected type

  • UnknownTypeError – if a type-argument fails to parse

  • OpenDPException – packaged error from the core OpenDP library

opendp.core.transformation_invoke(transformation, arg)[source]#

Invoke the transformation with arg. The response is not differentially private as it has not been chained with a measurement.

Parameters:
  • transformation (Transformation) – Transformation to invoke.

  • arg (Any) – Input data to supply to the measurement. A member of the transformations’s input domain.

Returns:

Non-differentially private answer to the query.

Return type:

Any

Raises:
  • AssertionError – if an argument’s type differs from the expected type

  • UnknownTypeError – if a type-argument fails to parse

  • OpenDPException – packaged error from the core OpenDP library

opendp.core.transformation_output_distance_type(transformation)[source]#

Get the output distance type of transformation.

Parameters:

transformation (Transformation) – The transformation to retrieve the type from.

Return type:

str

Raises:
  • AssertionError – if an argument’s type differs from the expected type

  • UnknownTypeError – if a type-argument fails to parse

  • OpenDPException – packaged error from the core OpenDP library