Differentially Private SQL Queries
Project description
SmartNoise SQL
Differentially private SQL queries. Tested with:
- PostgreSQL
- SQL Server
- Spark
- Pandas (SQLite)
- PrestoDB
SmartNoise is intended for scenarios where the analyst is trusted by the data owner. SmartNoise uses the OpenDP library of differential privacy algorithms.
Installation
pip install smartnoise-sql
Using
import snsql
from snsql import Privacy
import pandas as pd
csv_path = 'PUMS.csv'
meta_path = 'PUMS.yaml'
data = pd.read_csv(csv_path)
privacy = Privacy(epsilon=1.0, delta=0.01)
reader = snsql.from_connection(data, privacy=privacy, metadata=meta_path)
result = reader.execute('SELECT sex, AVG(age) AS age FROM PUMS.PUMS GROUP BY sex')
print(result)
Communication
- You are encouraged to join us on GitHub Discussions
- Please use GitHub Issues for bug reports and feature requests.
- For other requests, including security issues, please contact us at smartnoise@opendp.org.
Releases and Contributing
Please let us know if you encounter a bug by creating an issue.
We appreciate all contributions. We welcome pull requests with bug-fixes without prior discussion.
If you plan to contribute new features, utility functions or extensions to this system, please first open an issue and discuss the feature with us.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
smartnoise-sql-0.2.0.dev0.tar.gz
(100.0 kB
view hashes)
Built Distribution
Close
Hashes for smartnoise-sql-0.2.0.dev0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 186a1260f4604138829bb4cc31308f7408140f21e27ceda7be69634ca0b2db83 |
|
MD5 | 14fd807bc143330566a32f6b790096b8 |
|
BLAKE2b-256 | 6ef9d19856f52de5011835f4e075d15f6778c6b96db45de0240e9416a41f0cff |
Close
Hashes for smartnoise_sql-0.2.0.dev0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e849d47a977b0b2ebaf5ee99e22e9c51b1434316ac307f046830c5676ffe458e |
|
MD5 | 9682f0c705c195fc79c80202740e7a98 |
|
BLAKE2b-256 | 38c30183124c5290a119ff057ef7d4e1de0b28047a3860b3769ee4fadd277700 |