Notebooks Guide
This guide covers environment-specific workflows, best practices, and common patterns for using Syft Client in Jupyter notebooks and Google Colab.Environment Detection
Syft Client automatically detects your environment and configures authentication accordingly:syft_client/sync/utils/syftbox_utils.py:10-17
Google Colab Workflows
Setup in Colab
Colab-Specific Features
Automatic Email Detection
Colab automatically detects your Google account email:syft_client/sync/utils/syftbox_utils.py:20-28
SyftBox Folder Location
In Colab, your SyftBox folder is located at:syft_client/sync/syftbox_manager.py:68-69
Complete Colab Example (Data Scientist)
Complete Colab Example (Data Owner)
Jupyter Workflows
Setup in Jupyter
Set up OAuth tokens
Follow the Authentication Guide to create OAuth tokens.
Jupyter-Specific Configuration
Environment Variable Setup
Set default token path in your notebook:syft_client/sync/config/config.py:5-12
SyftBox Folder Location
In Jupyter, your SyftBox folder is in your home directory:syft_client/sync/syftbox_manager.py:64-65
Complete Jupyter Example (Data Scientist)
Complete Jupyter Example (Data Owner)
Best Practices for Notebooks
1. Cell Organization
Organize your notebook into clear sections:2. Disable Auto-Sync for Exploratory Work
syft_client/sync/syftbox_manager.py:419
3. Error Handling in Notebooks
4. Progress Tracking
5. Visualization in Notebooks
Writing Job Code in Notebooks
Method 1: Write to File
Method 2: Use %%writefile Magic (Jupyter)
Method 3: Project Folder (Complex Jobs)
Performance Tips
Minimize Sync Calls
Cache Results Locally
Use Checkpoints (Data Owners)
syft_client/sync/syftbox_manager.py:1246-1264
Troubleshooting in Notebooks
Colab: “Email is required” Error
If auto-detection fails:Jupyter: Import Errors
Ensure you’re using the correct kernel:Restart Runtime After Installation
In Colab, restart the runtime after installing:View Debug Information
Next Steps
Data Scientist Guide
Learn the complete data scientist workflow
Data Owner Guide
Manage datasets and approve jobs
Authentication Guide
Set up OAuth tokens for Jupyter
API Reference
Explore the full API documentation