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.1-cp38-cp38-manylinux1_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.8

python_dp-0.1.1-cp37-cp37m-manylinux1_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.7m

python_dp-0.1.1-cp36-cp36m-manylinux1_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.6m

python_dp-0.1.1-cp35-cp35m-manylinux1_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.5m

File details

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

File metadata

  • Download URL: python_dp-0.1.1-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for python_dp-0.1.1-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d1d2977ef5d40120fe381139f070975cc0024ce3b500a8f4262d4a13081f4f2c
MD5 86cc52c2c395d05c72baf4b61859440d
BLAKE2b-256 5328845da77975721d9c1f1e53d2498f9898c72bc5e02d73c8bc827bfab424e3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_dp-0.1.1-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.6

File hashes

Hashes for python_dp-0.1.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 86b0ebae4124dff3768428009d18f09f7e0b86efa97d680148402afb1b5f87a9
MD5 acb4f30fac0319d03241d768e98c44ef
BLAKE2b-256 b1a9bb086be9706b070975a78f1ec2bada91611dd4db70151b5bad71de5a5ff2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_dp-0.1.1-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.10

File hashes

Hashes for python_dp-0.1.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 475b406b48a680edf19a590828259181f3168cab0faaf0d0d0a80750b31ed549
MD5 c1a203cc451f9718402771f672374a4f
BLAKE2b-256 495b9cebf10b3f119cac486bb6d2e92e8dbb2b68d2a9ab62c9b9636f8b39e9a2

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for python_dp-0.1.1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b0a63894c8fcf075230be36fffea781a12caba2a7e452e93188e721a32962839
MD5 604172a34933c397261cc77c40795c50
BLAKE2b-256 936ebe9740ff3bc61c3c87f77ab063fde2637cf43b73cab436a54d7b6164dee2

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