{"id":13499503,"url":"https://github.com/OpenMined/PyDP","last_synced_at":"2025-03-29T05:31:38.237Z","repository":{"id":38822710,"uuid":"208594579","full_name":"OpenMined/PyDP","owner":"OpenMined","description":"The Python Differential Privacy Library. Built on top of: https://github.com/google/differential-privacy","archived":false,"fork":false,"pushed_at":"2024-09-11T13:21:45.000Z","size":4992,"stargazers_count":505,"open_issues_count":55,"forks_count":139,"subscribers_count":20,"default_branch":"dev","last_synced_at":"2024-10-12T01:37:24.623Z","etag":null,"topics":["cpp","differential-privacy","hacktoberfest","python","python-wrapper"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenMined.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"openmined","open_collective":"openmined"}},"created_at":"2019-09-15T12:58:45.000Z","updated_at":"2024-10-08T15:33:40.000Z","dependencies_parsed_at":"2023-10-14T21:20:58.427Z","dependency_job_id":"777bbfbe-6143-4014-bfea-ce95dc75503d","html_url":"https://github.com/OpenMined/PyDP","commit_stats":{"total_commits":545,"total_committers":61,"mean_commits":8.934426229508198,"dds":0.6348623853211008,"last_synced_commit":"a840a979f80223cc2c4276296e8efe7f6952cec8"},"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenMined%2FPyDP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenMined%2FPyDP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenMined%2FPyDP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenMined%2FPyDP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenMined","download_url":"https://codeload.github.com/OpenMined/PyDP/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222465370,"owners_count":16989000,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","differential-privacy","hacktoberfest","python","python-wrapper"],"created_at":"2024-07-31T22:00:33.808Z","updated_at":"2024-10-31T18:30:40.152Z","avatar_url":"https://github.com/OpenMined.png","language":"Python","readme":"![Tests](https://img.shields.io/github/workflow/status/OpenMined/PyDP/Tests)\n![Version](https://img.shields.io/github/v/tag/OpenMined/PyDP?color=green\u0026label=pypi)\n![License](https://img.shields.io/github/license/OpenMined/PyDP)\n\n# PyDP\n\nIn today's data-driven world, more and more researchers and data scientists\nuse machine learning to create better models or more innovative solutions for\na better future.\n\nThese models often tend to handle sensitive or personal data, which can cause\nprivacy issues. For example, some AI models can memorize details about\nthe data they've been trained on and could potentially leak these details later\non.\n\nTo help measure sensitive data leakage and reduce the possibility of it\nhappening, there is a mathematical framework called differential privacy.\n\nIn 2020, OpenMined created a Python wrapper for Google's [Differential\nPrivacy](https://github.com/google/differential-privacy) project called PyDP.\nThe library provides a set of ε-differentially private algorithms, which can be\nused to produce aggregate statistics over numeric data sets containing private\nor sensitive information. Therefore, with PyDP you can control the privacy\nguarantee and accuracy of your model written in Python.\n\n**Things to remember about PyDP:**\n\n- :rocket: Features differentially private algorithms including: BoundedMean,\nBoundedSum, Max, Count Above, Percentile, Min, Median, etc.\n  - All the computation methods mentioned above use Laplace noise only (other\nnoise mechanisms will be added soon! :smiley:)\n- :fire: Compatible with all three types of Operating Systems - Linux, macOS, and Windows :smiley:\n- :star: Use Python 3.x.\n\n## Installation\n\nTo install PyDP, use the [PyPI](https://pip.pypa.io/en/stable/) package manager:\n\n```bash\npip install python-dp\n```\n\n(If you have `pip3` separately for Python 3.x, use `pip3 install python-dp`.)\n\n## Examples\n\nRefer to the\n[curated list](https://github.com/OpenMined/PyDP/tree/dev/examples)\nof tutorials and sample code to learn more about the PyDP library.\n\nYou can also get started with\n[an introduction to PyDP](https://github.com/OpenMined/PyDP/blob/dev/examples/Tutorial_1-carrots_demo/carrots_demo.ipynb)\n(a Jupyter notebook) and\n[the carrots demo](https://github.com/OpenMined/PyDP/blob/dev/examples/Tutorial_1-carrots_demo/carrots.py)\n(a Python file).\n\nExample: calculate the Bounded Mean\n\n```python\n# Import PyDP\nimport pydp as dp\n# Import the Bounded Mean algorithm\nfrom pydp.algorithms.laplacian import BoundedMean\n\n# Calculate the Bounded Mean\n# Basic Structure: `BoundedMean(epsilon: float, lower_bound: Union[int, float, None], upper_bound: Union[int, float, None])`\n# `epsilon`: a Double, between 0 and 1, denoting the privacy threshold,\n#            measures the acceptable loss of privacy (with 0 meaning no loss is acceptable)\nx = BoundedMean(epsilon=0.6, lower_bound=1, upper_bound=10)\n\n# If the lower and upper bounds are not specified,\n# PyDP automatically calculates these bounds\n# x = BoundedMean(epsilon: float)\nx = BoundedMean(0.6)\n\n# Calculate the result\n# Currently supported data types are integers and floats\n# Future versions will support additional data types\n# (Refer to https://github.com/OpenMined/PyDP/blob/dev/examples/carrots.py)\nx.quick_result(input_data: list)\n```\n\n## Learning Resources\n\nGo to [resources](https://github.com/OpenMined/PyDP/blob/dev/resources.md)\nto learn more about differential privacy.\n\n## Attack Model\n\nPlease refer to the\n[attack model](https://github.com/google/differential-privacy/blob/main/common_docs/attack_model.md)\nof the underlying Google Differential Privacy Library to learn\nmore about our assumptions and requirements for using PyDP in\na safe way.\n\n## Support and Community on Slack\n\nIf you have questions about the PyDP library, join\n[OpenMined's Slack](https://slack.openmined.org) and check the\n**#lib_pydp** channel. To follow the code source changes, join\n**#code_dp_python**.\n\n## Contributing\n\nTo contribute to the PyDP project, read the\n[guidelines](https://github.com/OpenMined/PyDP/blob/dev/contributing.md).\n\nPull requests are welcome. If you want to introduce major changes, please\nopen an issue first to discuss what you would like to change.\n\nPlease make sure to update tests as appropriate.\n\n\u003c!-- ## Contributors --\u003e\n\n## License\n[Apache License 2.0](https://choosealicense.com/licenses/apache-2.0/)\n","funding_links":["https://github.com/sponsors/openmined","https://opencollective.com/openmined"],"categories":["Differential Privacy Tools","Libraries","Python","Tools","5.4 DP Libraries","Securing AI SaaS","Code and Projects","Awesome Privacy Engineering [![Awesome](https://awesome.re/badge.svg)](https://awesome.re)","Defense \u0026 Security Controls"],"sub_categories":["Interfaces","Winetricks","Objective-C Tools, Libraries, and Frameworks","Mesh networks","Defensive Tools and Frameworks","Differential Privacy and Federated Learning","Privacy \u0026 Confidential Computing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpenMined%2FPyDP","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FOpenMined%2FPyDP","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpenMined%2FPyDP/lists"}