PySyft README

The project's README from github.com/OpenMined/PySyft. As one markdown file: README.md.

Syft Logo

PySyft v2

syft 0.10+ is the successor of syft-client. syft is the sync engine (import syft as sy); datasets and jobs live in syft-rds (from syft_rds import login_do, login_ds). If you depend on the legacy PySyft ≤0.9 API, pin syft<0.10.

Unit Tests Integration Tests PyPI Python 3.10+ License: Apache 2.0

PySyft lets data scientists submit computations which are run by data owners on private data — all through cloud storage their organizations already use (Google Drive, Microsoft 365, etc.). No new infrastructure required.

Docs

Tutorials

Features

Quick Start

We assume two parties here, a Data Owner (DO) and a Data Scientist (DS), the DS wants to do an analysis on private data of the DO. For brevity we use code blocks, but in practice these would be distributed: each party executes their code on their own machine.

# Data scientist
uv pip install "syft>=0.10.0" "syft-rds>=0.6.0"
# Data owner (adds the background services)
uv pip install "syft>=0.10.0" "syft-rds>=0.6.0" "syft-bg>=0.3.12"
import syft as sy                          # sync engine + helpers (resolve_dataset_file_path, bug_report, ...)
from syft_rds import login_do, login_ds    # datasets + jobs (the Remote Data Science client)
# Login (colab auth, for non-colab pass token_path)
do = login_do(email="[email protected]") # use your own email
ds = login_ds(email="[email protected]") # use another email here

# Peer request & approve
ds.add_peer("[email protected]")
do.approve_peer_request("[email protected]")

# Create & sync dataset
do.create_dataset(
    name="census",
    mock_path="mock.txt", # create this and add some text
    private_path="private.txt", # create this and add some text
    users=["[email protected]"],
)
do.sync(); ds.sync()
datasets = ds.datasets.get_all()

Write an analysis.py that reads the dataset and produces a result in our case this is just the length of the data. Inside a job, resolve_dataset_file_path automatically resolves to the private data:

# analysis.py
import json
import syft as sy

data_path = sy.resolve_dataset_file_path("census")
with open(data_path, "r") as f:
    data = f.read()

with open("outputs/result.json", "w") as f:
    json.dump({"length": len(data)}, f)

Submit the job and retrieve results:

# Submit job
ds.submit_python_job(
    user="[email protected]",
    code_path="analysis.py",
)
ds.sync(); do.sync()

# Data owner Approves & runs job
do.jobs[0].approve()
do.process_approved_jobs(share_outputs_with_submitter=True)
do.sync(); ds.sync()
result = open(ds.jobs[-1].output_paths[0]).read()

Packages

Package Description
syft-rds Remote Data Science client: login_do/login_ds, datasets, jobs
syft-datasets Dataset management and sharing
syft-job Job submission and execution
syft-permissions Permission system for Syft datasites
syft-perms User-facing permission API for Syft datasites
syft-bg Background services TUI dashboard for SyftBox
syft-notebook-ui Jupyter notebook display utilities

Development

# Install in development mode
uv pip install -e .

# Run tests
just test-unit          # Unit tests (fast, mocked)
just test-integration   # Integration tests (slow, real API)

Built by OpenMined — building open-source technology for privacy-preserving data science and AI.

Support

For questions about PySyft, reach out via #support on Slack.

Community

Supported by the OpenMined Foundation, the OpenMined Community is an online network of over 17,000 technologists, researchers, and industry professionals keen to unlock 1000x more data in every scientific field and industry.

Contributors

OpenMined and Syft appreciates all contributors, if you would like to fix a bug or suggest a new feature, please reach out via Github or Slack!

Contributors

About OpenMined

OpenMined is a non-profit foundation creating technology infrastructure that helps researchers get answers from data without needing a copy or direct access. Our community of technologists is building Syft.

Supporters

License

Apache License 2.0
Person icons created by Freepik - Flaticon

PySyft (OpenMined/PySyft)

Searching Database…

10K ·GitHub
这是什么?PySyft(即 syft 包)让你可以对留在别人服务器上的数据做数据科学分析,研究人员无需拿到数据副本或直接访问数据,也能从中得到答案。
这是我导入的库,还是一个独立应用?它是一个以 `syft` 名称导入的 Python 库/同步引擎,另有一个单独的包(`syft-rds`)负责管理数据集和任务。
我该怎么开始使用它?安装 `syft` 包并 `import syft as sy` 来使用同步引擎;要管理数据集和任务,还需要通过 `from syftrds import logindo, loginds` 使用 `syft-rds`。
使用它需要 PyTorch 吗?从其列出的主题标签来看,该项目围绕 PyTorch 以及深度学习/联邦学习工作流构建,不过这份 README 摘录并未详细说明确切的依赖要求。
这次更新之后,我现有的 PySyft 代码还能继续用吗?不能——syft 0.10+ 是取代旧 syft-client 的全新架构;如果你的代码依赖旧版 PySyft ≤0.9 的 API,就需要锁定较旧的 syft 版本,而不是升级。
如果我从不复制数据,它如何保护数据隐私?它由 OpenMined 构建,目的就是让研究人员无需拿到数据副本或直接访问数据本身,也能从数据中得到答案,数据始终保留在原始服务器上。
Syft 用哪些技术来保护数据?从其 GitHub 主题标签来看,Syft 结合了密码学、安全计算和联邦学习,让计算可以在远程数据上运行而不暴露数据。
有没有我应该了解的旧版本?有。0.10 之前该项目采用的是不同的架构(syft-client);如果你需要那种旧有行为,应锁定 PySyft ≤0.9 版本。
Creator
OpenMined
Size
766.3 MB
Stars
10K
Age
9y
Commits · 90 Days