A Python API for installing and managing the SyftBox daemon — perfect for notebooks and automation
Install SyftBox (if needed) and start it. This is the primary method for most users. It will install SyftBox if not already installed, then start the daemon.
No parameters - uses interactive prompts |
None | Starts SyftBox daemon in the background |
import syft_installer as si
# Install and run SyftBox
si.run()
Install SyftBox without starting it. Useful for deployment scenarios where you want to install first and start later.
No parameters - uses interactive prompts |
None | Completes installation without starting the daemon |
# Just install, don't start
si.install()
# Start later when ready
si.run_if_stopped()
Explicit method to install (if needed) and run (if needed) SyftBox. Only installs if not already installed and only starts if not already running about the two-step process.
No parameters - uses interactive prompts |
None | Completes installation and starts the daemon |
Completely remove SyftBox from the system. This will stop the daemon, remove the binary, configuration files, and optionally the data directory.
No parameters - prompts for confirmation |
None | Removes all SyftBox components |
# Completely uninstall SyftBox
si.uninstall()
# Will prompt: "Are you sure? [y/N]"
Start SyftBox only if it's not already running. Useful for scripts that need to ensure SyftBox is running without accidentally starting multiple instances.
No parameters |
None | Starts daemon if not running, otherwise no-op |
# Ensure SyftBox is running
si.run_if_stopped()
# Safe to call multiple times
for i in range(3):
si.run_if_stopped() # Only starts once
Stop the SyftBox daemon if it's running. This gracefully shuts down the background process.
No parameters |
None | Stops the daemon process |
# Stop SyftBox
si.stop()
# Check if it stopped
if not si.is_running():
print("SyftBox stopped successfully")
Display the current status of SyftBox including installation state, running status, configuration details, and data directory information.
No parameters |
None | Prints status information to console |
# Check SyftBox status
si.status()
# Output:
# ✅ SyftBox Status:
# Installation: ✅ Installed
# Status: ✅ Running (PID: 12345)
# Email: user@example.com
# Data Dir: /Users/user/SyftBox
# Server: https://syftbox.openmined.org
Check if SyftBox is installed on the system. Returns True if all necessary components (binary, configuration) are present.
No parameters |
bool | True if SyftBox is installed, False otherwise |
if si.is_installed():
print("SyftBox is ready to use")
else:
print("Need to install SyftBox first")
si.install()
Check if the SyftBox daemon is currently running in the background.
No parameters |
bool | True if SyftBox daemon is running, False otherwise |
if si.is_running():
print("SyftBox is active")
else:
print("SyftBox is stopped")
si.run_if_stopped()