Skip to main content

Install Syft Client

pip install syft-client
uv is recommended for faster installs and is required for job execution. Install it with pip install uv if you don’t have it.

Set up Google Drive credentials

Syft Client uses Google Drive for peer-to-peer sync. You’ll need OAuth credentials:
1

Create a Google Cloud project

  1. Go to the Google Cloud Console
  2. Create a new project or select an existing one
  3. Enable the Google Drive API for your project
2

Create OAuth credentials

  1. Go to APIs & Services > Credentials
  2. Click Create Credentials > OAuth client ID
  3. Choose Desktop app as the application type
  4. Download the credentials JSON file
3

Save your token file

Save the downloaded credentials file to a secure location:
mkdir -p ~/.syft
mv ~/Downloads/client_secret_*.json ~/.syft/token.json
Never commit your token file to version control! Add it to .gitignore.

Your first login

Syft Client has two roles:
  • Data Owner (DO): Hosts datasets, approves jobs, and executes computations
  • Data Scientist (DS): Discovers datasets and submits jobs for execution

Login as a Data Scientist

Most users start as Data Scientists:
import syft_client as sc

# Login as a Data Scientist
client = sc.login_ds(
    email="[email protected]",
    token_path="~/.syft/token.json"
)

# You should see:
# Client connected successfully!
# Email: [email protected]
# SyftBox folder: /Users/you/[email protected]
The first login will open a browser for Google OAuth authorization. Grant the requested permissions to allow Syft Client to access your Google Drive.

Login as a Data Owner

If you’re hosting datasets and approving jobs:
import syft_client as sc

# Login as a Data Owner
client = sc.login_do(
    email="[email protected]",
    token_path="~/.syft/token.json"
)
The main difference: login_do() creates job execution infrastructure, while login_ds() is optimized for browsing and submitting jobs.

Connect with a peer

To collaborate, Data Scientists request access to Data Owners:
1

Data Scientist requests access

# Request access to a Data Owner
client.add_peer("[email protected]")
2

Data Owner approves the request

# As the Data Owner, load and view pending requests
client.load_peers()
print(client.peers)

# Approve a specific request
client.approve_peer_request("[email protected]")
3

Both sync to see updated peer list

# Sync to get latest changes
client.sync()

# View all peers
print(client.peers)

Submit your first job

Now that you’re connected, submit a simple Python job:
# Save this as analysis.py
import pandas as pd
import sys

print("Hello from Syft Client!")
print(f"Python version: {sys.version}")
print(f"Pandas version: {pd.__version__}")

# Job output will be automatically synced back
with open("output.txt", "w") as f:
    f.write("Job completed successfully!")

Approve and execute jobs (Data Owner)

As the Data Owner, approve and run the submitted job:
import syft_client as sc

client = sc.login_do(
    email="[email protected]",
    token_path="~/.syft/token.json"
)

# View all jobs
print(client.jobs)

# Approve a job by accessing it
job = client.jobs[0]
job.approve()

# Process all approved jobs
client.process_approved_jobs(
    stream_output=True,  # See output in real-time
    share_outputs_with_submitter=True  # Share results back
)
Jobs run in isolated virtual environments with automatic dependency installation using uv.

Check job results

After execution, the Data Scientist can access results:
import syft_client as sc

client = sc.login_ds(
    email="[email protected]",
    token_path="~/.syft/token.json"
)

# Sync to get latest results
client.sync()

# View job status
print(client.jobs)

# Access job results (if shared)
job = client.jobs[0]
if job.status == "done":
    output_file = job.location / "output.txt"
    if output_file.exists():
        print(output_file.read_text())

What’s next?

Work with Datasets

Learn how to create, share, and download datasets

Advanced Job Submission

Submit entire project folders with dependencies

Manage Permissions

Control file access with the declarative permission system

API Reference

Explore the complete API documentation

Build docs developers (and LLMs) love