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

Uploaded CPython 3.8

python_dp-0.1.2-cp38-cp38-macosx_10_15_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

python_dp-0.1.2-cp37-cp37m-manylinux1_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.7m

python_dp-0.1.2-cp37-cp37m-macosx_10_15_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.7m macOS 10.15+ x86-64

python_dp-0.1.2-cp36-cp36m-manylinux1_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.6m

python_dp-0.1.2-cp36-cp36m-macosx_10_15_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.6m macOS 10.15+ x86-64

python_dp-0.1.2-cp35-cp35m-manylinux1_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.5m

python_dp-0.1.2-cp35-cp35m-macosx_10_15_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.5m macOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: python_dp-0.1.2-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.5 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.3

File hashes

Hashes for python_dp-0.1.2-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3747b117ad5e04414849ad982b506c6ff4bc41371014a8c1d80c93ac01bb85d0
MD5 f7327aeedd40f2666b8dda4f4927427c
BLAKE2b-256 39170976ea2334accc7f942c6b832bc493339a428cb2a93e9935551c898ac8cb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_dp-0.1.2-cp38-cp38-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.8, macOS 10.15+ x86-64
  • 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.3

File hashes

Hashes for python_dp-0.1.2-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 46550898b7e533cdbdc3d3f2d3d9f6d2311aafa66f78e43dd99134fb652dffb8
MD5 ac284a7aa5718f7b4e238dc1cc9c39bc
BLAKE2b-256 4d4484112629a0ef71b27e471e390ac4ed01fe02a3c5a287184b0ed7ad7279eb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_dp-0.1.2-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.5 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.7

File hashes

Hashes for python_dp-0.1.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a1b97800ea444f2de9defe88639ea3f40c3756866e3b8c2e3671d43d28e16e4c
MD5 90c7125259daacc0e428600de412075c
BLAKE2b-256 934bf354eb72713469e45d5c43a02226155337be8f0d3a01192d6332c0751fc3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_dp-0.1.2-cp37-cp37m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.7m, macOS 10.15+ x86-64
  • 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.7

File hashes

Hashes for python_dp-0.1.2-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 10ccd5142bd7d3c529c3ae67c88b426a52768d4715eddd1e2a3ec59c65387469
MD5 4506d0489c87878e85da918e8b852176
BLAKE2b-256 0292eaa33bb8009de8a1024f3d2c041fdd9b6d2c29e22b1a476016a3c49cecba

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_dp-0.1.2-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.5 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.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d6874c4e9fa7260f380ea9b2b3e3e552c752f86ab3ac67543521bde91acebb6a
MD5 05e171f7e782d7f675b77fc548217275
BLAKE2b-256 97dce022dabcc6d1ffd0532ba12b9a75d14e280869bf54ea539daf7b361daf46

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_dp-0.1.2-cp36-cp36m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.6m, macOS 10.15+ x86-64
  • 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.2-cp36-cp36m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 a1aa5485c78ca71460848c3a8b6b46511fbd1a0ae0ae6b3b3ee0cb3ebc05fec7
MD5 4a0d563bb83f3860dddf52bf30521daa
BLAKE2b-256 ab15c4c371dcf9bd27312617f86aca9b800c6f92f69af5855d6ecb0f43d5d703

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_dp-0.1.2-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.5 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.2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a5f2ce9f2936c720410525935ef1b1e28e396e6a505ebd6f40135b6136938d17
MD5 515ce08e7094597c1c552bbaa6e1afb8
BLAKE2b-256 50a0391d9f62a5a519d1eca55699d034d9162edbaa1e78155bdb343abee05131

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_dp-0.1.2-cp35-cp35m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 2.4 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.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.2-cp35-cp35m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 314859e6d17f866841b83f5fc2404a7fa63d6139d77e6322587434065558c141
MD5 a2c49a1986f63ba8c043d0199f0d96fb
BLAKE2b-256 895faabbf94e8220875e788b7a3f090c6a50627850386500384c0863aac53051

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