Skip to main content

Python API for Google's Differential Privacy library

Project description

Introduction

PyDP is a Python wrapper for Google’s Differential Privacy project. The library provides a set of ε-differentially private algorithms, which can be used to produce aggregate statistics over numeric data sets containing private or sensitive information.

PyDP is part of the OpenMined community, come join the movement on Slack.

Instructions

If you’d like to contribute to this project please read these guidelines.

Usage

As part of the 0.1.1 dev release, we have added all functions required in carrots demo.

To install the package: pip install python-dp

import pydp as dp # imports the DP library

# To calculate the Bounded Mean
# epsilon is a number between 0 and 1 denoting privacy threshold
# It measures the acceptable loss of privacy (with 0 meaning no loss is acceptable)
# If both the lower and upper bounds are specified,
# x = dp.BoundedMean(epsilon: double, lower: int, upper: int)
x = dp.BoundedMean(0.6, 1, 10)

# If lower and upper bounds are not specified,
# DP library automatically calculates these bounds
# x = dp.BoundedMean(epsilon: double)
x = dp.BoundedMean(0.6)

# To get the result
# Currently supported data types are integer and float. Future versions will support additional data types
# Refer to examples/carrots.py for an introduction
x.result(input_data: list)

Known issue: If the privacy budget (epsilon is too less), we get a StatusOR error in the command line. While this needs to be raised as an error, right now, it’s just displayed as an error in logs.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

python_dp-0.1.7-cp38-cp38-manylinux1_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.8

python_dp-0.1.7-cp38-cp38-macosx_10_15_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

python_dp-0.1.7-cp37-cp37m-manylinux1_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.7m

python_dp-0.1.7-cp37-cp37m-macosx_10_15_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.7m macOS 10.15+ x86-64

python_dp-0.1.7-cp36-cp36m-manylinux1_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.6m

python_dp-0.1.7-cp36-cp36m-macosx_10_15_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.6m macOS 10.15+ x86-64

python_dp-0.1.7-cp35-cp35m-manylinux1_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.5m

python_dp-0.1.7-cp35-cp35m-macosx_10_15_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.5m macOS 10.15+ x86-64

File details

Details for the file python_dp-0.1.7-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: python_dp-0.1.7-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for python_dp-0.1.7-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 4e9cc27557585293a516c6671e2549464989d5a1a1259b6ae9b9e7ec68530cb8
MD5 45349c9664c1c0ff7e1faa8d58294c0c
BLAKE2b-256 5e926e8c80beea777789719677af0bd095fff35f003d2a4993d0a5b983923b45

See more details on using hashes here.

File details

Details for the file python_dp-0.1.7-cp38-cp38-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: python_dp-0.1.7-cp38-cp38-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 2.9 MB
  • Tags: CPython 3.8, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for python_dp-0.1.7-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 c65a19a89c36698647cb8ae5f9b1b5a0c7ce7814605ecbda80b6bd6de689ef7d
MD5 5aac3446305741e8041dccac4a2bf4c3
BLAKE2b-256 6c0cdd52a07847205fccd3ea6b285dec7ced29ec3c3375252190f26c408a6380

See more details on using hashes here.

File details

Details for the file python_dp-0.1.7-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: python_dp-0.1.7-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.8

File hashes

Hashes for python_dp-0.1.7-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 dc01a7114674b2690b422417da56c9bb7b717ab1a943ffba748cb23a34cd0de7
MD5 ebc99ee65f7631cd40db5dd0ddcc84d3
BLAKE2b-256 c665f6ee715f72b4ed614e411ca81c921ecd75d7c767193eb53b2d5ed7bbf930

See more details on using hashes here.

File details

Details for the file python_dp-0.1.7-cp37-cp37m-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: python_dp-0.1.7-cp37-cp37m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 2.9 MB
  • Tags: CPython 3.7m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.8

File hashes

Hashes for python_dp-0.1.7-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 8644cfeec58558e5ff8ff38b01eb46c079611ff14e5fb94aeaf89830032790db
MD5 193e3f50471066241f106cd2c041f93a
BLAKE2b-256 c2851522b26fe889eabe759c4df319e348e6cf30cdb317412ed8f3cea4d5a76a

See more details on using hashes here.

File details

Details for the file python_dp-0.1.7-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: python_dp-0.1.7-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.11

File hashes

Hashes for python_dp-0.1.7-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a622b91fe6b7587d5882871aaf5b217881fdf4527aa318c894ee6de39e2a7ded
MD5 cb48dfb46d357edcd56b902cbff30da5
BLAKE2b-256 917eaba588a3b69ca0ccd0bf73deac11ea17c2114041f15dac92f8698decca00

See more details on using hashes here.

File details

Details for the file python_dp-0.1.7-cp36-cp36m-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: python_dp-0.1.7-cp36-cp36m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 2.9 MB
  • Tags: CPython 3.6m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.11

File hashes

Hashes for python_dp-0.1.7-cp36-cp36m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 5145a69a7771718e5e7b1c3fffdb5b92f72d638e6e6372cb4dcd257699dd4bfc
MD5 da061c51a1940367d83ada68a6896dd9
BLAKE2b-256 3567cf466d1b28559d1fb00665ce503346ff5538b98f8a3c66d8a6c27ce2e11c

See more details on using hashes here.

File details

Details for the file python_dp-0.1.7-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

  • Download URL: python_dp-0.1.7-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.5.9

File hashes

Hashes for python_dp-0.1.7-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7ab394f52733be6820dd3c3383585da1b6cf70516ff30c25da4c714233e765e5
MD5 a79f943d814bc1cd9802cb4a993cedd0
BLAKE2b-256 61118a15fa46954fa0214f5678d0360afa935ade71236369eeb3d4de7335751c

See more details on using hashes here.

File details

Details for the file python_dp-0.1.7-cp35-cp35m-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: python_dp-0.1.7-cp35-cp35m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 2.9 MB
  • Tags: CPython 3.5m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.5.9

File hashes

Hashes for python_dp-0.1.7-cp35-cp35m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 36c65cdf2c3d3d688f73377864e3951b5accf5f936e3926ad6d4cccbf803623b
MD5 29bacb13f4ce20407a903da71411b5ad
BLAKE2b-256 692914f872cdc51277eef6f5c4669d0fe21826c066b7c8bb299989beabbdb5bc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page