{"id":45693,"library":"opendp","title":"OpenDP","description":"Python bindings for the OpenDP Library, a modular collection of tools for differential privacy. Current version 0.15.1, released approximately quarterly. Provides a high-level API for privacy-preserving data analysis.","status":"active","version":"0.15.1","language":"python","source_language":"en","source_url":"https://github.com/opendp/opendp","tags":["differential-privacy","privacy","statistics"],"install":[{"cmd":"pip install opendp","lang":"bash","label":"Default install"}],"dependencies":[],"imports":[{"note":"Measurement is in opendp.typing","wrong":"from opendp import Measurement","symbol":"Measurement","correct":"from opendp.typing import Measurement"},{"note":"Transformations are in opendp.transformations","wrong":"from opendp import then_count","symbol":"then_count","correct":"from opendp.transformations import then_count"},{"note":"Measurements are in opendp.measurements","wrong":"from opendp import base_laplace","symbol":"base_laplace","correct":"from opendp.measurements import base_laplace"}],"quickstart":{"code":"import opendp\nfrom opendp.transformations import make_split_dataframe, make_select_column, then_count, then_clamp, then_resize, then_variance, then_mean\nfrom opendp.measurements import then_laplace, then_gaussian\nfrom opendp.domains import vector_domain, atom_domain\nfrom opendp.metrics import symmetric_distance\nfrom opendp.typing import L2Sensitivity\n\ncontext = opendp.Context.compositor(\n    data=... , # your data\n    privacy_unit=opendp.parameters.unit('epsilon=1, delta=0.01')\n)\n# Example: count with Laplace noise\nmeas = (opendp.preprocessing.make_split_dataframe(\",\", [\"A\", \"B\"])) >> \\\n       (opendp.transformations.make_select_column(\"A\", TOA=str)) >> \\\n       (then_count()) >> \\\n       (then_laplace(scale=1.0))\nreleased = meas(meas.arg)\nprint(released)\n","lang":"python","description":"Simple differential privacy count query using OpenDP's compositor and transformation chain."},"warnings":[{"fix":"Ensure every measurement/transformation includes explicit type parameters. E.g., `then_laplace(scale=1.0, TO=int)`.","message":"Breaking change in 0.15: Many functions now require explicit typing and domain/metric arguments. Old patterns like `base_laplace()` without explicit `TO` or `L2Sensitivity` fail.","severity":"breaking","affected_versions":">=0.15"},{"fix":"Use transformation chains ending with measurement, e.g., `then_count() >> then_laplace(scale=1.0)`.","message":"`make_count` and similar direct measurements are replaced by `then_count` and chaining operations.","severity":"deprecated","affected_versions":">=0.9"},{"fix":"Use the lower-level combinator API (e.g., `make_chain_mt`) for stability.","message":"The Context API is not yet stable and may change. Avoid relying on it for production code.","severity":"gotcha","affected_versions":"<1.0"},{"fix":"Use `opendp.parameters.unit('epsilon=1, delta=0.01')`.","message":"Privacy parameters epsilon and delta must be passed as a single string, not separate arguments.","severity":"gotcha","affected_versions":">=0.12"}],"env_vars":null,"search_vec":"'0.15.1':18 'analysi':33 'api':27 'approxim':20 'bind':3 'collect':10 'current':16 'data':32 'differenti':14,35 'differential-privaci':34 'high':25 'high-level':24 'level':26 'librari':7 'modular':9 'opendp':1,6 'preserv':31 'privaci':15,30,36,37 'privacy-preserv':29 'provid':22 'python':2 'quarter':21 'releas':19 'statist':38 'tool':12 'version':17","created_at":"2026-06-07T12:56:15.946606+00:00","updated_at":"2026-06-07T12:56:15.946606+00:00","problems":[{"fix":"Use `from opendp.transformations import ...` instead of `opendp.transformations.make_count`.","cause":"Older import pattern; opendp submodules are not directly exposed.","error":"AttributeError: module 'opendp' has no attribute 'transformations'"},{"fix":"Always provide scale: `base_laplace(scale=1.0)`.","cause":"Base measurements require scale as an argument; old code might have used default.","error":"TypeError: base_laplace() missing 1 required positional argument: 'scale'"},{"fix":"Ensure the chain consists of transformations ending with a measurement; use `>>` operator.","cause":"Using a transformation or measurement before preparing context or chaining correctly.","error":"NotImplementedError: This operation is not supported."},{"fix":"Use `from opendp.transformations import then_count`.","cause":"`make_count` was removed or renamed to `then_count`.","error":"ImportError: cannot import name 'make_count' from 'opendp.transformations'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://opendp.org","github":"https://github.com/opendp/opendp","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["security"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}