Skip to main content

Deprecated!

Notice: SmartNoise-Core is deprecated. Please migrate to the OpenDP library:


Deprecated!

License: MIT Python

SmartNoise Core Differential Privacy Library Python Bindings



This repository contains python bindings to the SmartNoise Core library and its underlying Rust binaries.


Differential privacy is the gold standard definition of privacy protection. This project aims to connect theoretical solutions from the academic community with the practical lessons learned from real-world deployments, to make differential privacy broadly accessible to future deployments. Specifically, we provide several basic building blocks that can be used by people involved with sensitive data, with implementations based on vetted and mature differential privacy research. In the Core library, we provide a pluggable open source library of differentially private algorithms and mechanisms for releasing privacy preserving queries and statistics, as well as APIs for defining an analysis and a validator for evaluating these analyses and composing the total privacy loss on a dataset.

This library provides an easy-to-use interface for building analyses.

Differentially private computations are specified as a protobuf analysis graph that can be validated and executed to produce differentially private releases of data.


More about SmartNoise Core Python Bindings

Components

For a full listing of the extensive set of components available in the library see this documentation.

Architecture

The SmartNoise Core library system architecture is described in the parent project. This package is an instance of the language bindings. The purpose of the language bindings is to provide a straightforward programming interface to Python for building and releasing analyses.

Logic for determining if a component releases differentially private data, as well as the scaling of noise, property tracking, and accuracy estimates are handled by a native rust library called the Validator. The actual execution of the components in the analysis is handled by a native Rust runtime.

Installation

Binaries

Initial Linux and OS X binaries are available on pypi for Python 3.6+:

The binaries have been used on OS X and Ubuntu and are in the process of additional testing.

From Source

  1. Clone the repository

    git clone --recurse-submodules git@github.com:opendifferentialprivacy/smartnoise-core-python.git
    

    If you have already cloned the repository without the submodule

    git submodule init
    git submodule update
    
  2. Install the SmartNoise Core dependencies

    Mac

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    xcode-select --install
    brew install protobuf python
    

    Linux

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    sudo apt-get install diffutils gcc make m4 python
    # snap for protobuf 3, because apt comes with protobuf 2
    sudo snap install protobuf --classic
    

    Windows

    Install WSL and refer to the linux instructions.

  3. Install live-reloading developer version of package

    pip3 install -r requirements/dev.txt
    pip3 install -e .
    
  4. Generate code (rerun anytime SmartNoise Core changes) Refer to troubleshooting.md if necessary.

    export WN_DEBUG=true # optional- for faster compilation and slower execution
    python3 scripts/code_generation.py
    
  5. Build documentation (optional)

    ./scripts/build_docs.sh
    

SmartNoise Core Documentation

Communication

Releases and Contributing

Please let us know if you encounter a bug by creating an issue.

We appreciate all contributions and welcome pull requests with bug-fixes without prior discussion.

If you plan to contribute new features, utility functions or extensions to the SmartNoise Core, please first open an issue and discuss the feature with us.

  • Sending a pull request (PR) without discussion might end up resulting in a rejected PR, because we may be taking the core in a different direction than you might be aware of.

There is also a contributing guide for new developers.

Release files for opendp-smartnoise-core 0.2.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for opendp-smartnoise-core 0.2.6
File Size Uploaded
opendp-smartnoise-core-0.2.6.tar.gz 68.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for opendp-smartnoise-core 0.2.6
File Interpreter ABI Platform
opendp_smartnoise_core-0.2.6-py3-none-any.whl Python 3 none any Details

Total release size: 124.7 kB

Release files / opendp-smartnoise-core-0.2.6.tar.gz

Download URL opendp-smartnoise-core-0.2.6.tar.gz
Size 68.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ae593f17603332a3996ac96f6c02a9722b66a636b25c511f012a40534f3bb1e3
BLAKE2b-256 checksum
How to use checksums
654d84fa05db4735d6bdcd417a469a32c7af62486612af22fdf12c7096ae4a45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.7

Release files / opendp_smartnoise_core-0.2.6-py3-none-any.whl

Download URL opendp_smartnoise_core-0.2.6-py3-none-any.whl
Size 56.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb5f7346ee52bbce409b4ce399e8db9995e6e51e8da6cea9f66e9c2f93431851
BLAKE2b-256 checksum
How to use checksums
6b4cc3543a173e804b5a93ee11749db4eff0cbe05832ff0c6657ed3c436e2ae0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.7

Release history Release notifications | RSS feed

This release

0.2.6 This release

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

1 release file

0.2.2

1 release file

0.2.0

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page