syft_client that help with common tasks like path resolution, dataset file access, and generating bug reports.
resolve_path()
Convertssyft:// URLs to absolute filesystem paths.
Parameters
Path to resolve (must start with
syft://)SyftBox folder location. If not provided, uses
SYFTBOX_FOLDER environment variable.Returns
Resolved pathlib.Path object pointing to the actual filesystem location
Raises
ValueError: Ifsyftbox_foldernot provided andSYFTBOX_FOLDERenv var not setValueError: If path doesn’t start withsyft://
Usage
This function is useful when working with syft:// URLs in job code or when you need to access files programmatically.
resolve_dataset_file_path()
Resolves a dataset name to its file path, automatically choosing between mock and private data based on context.Parameters
Name of the dataset to resolve
SyftBox folder location. If not provided, inferred from
client or SYFTBOX_FOLDER env var.Email of the dataset owner. If not provided, inferred from
client or SYFTBOX_EMAIL env var.SyftboxManager instance to use for resolution. Provides syftbox_folder and can resolve owner_email.
Returns
Path to the dataset files directory (mock or private based on context)
Behavior
The function automatically determines whether to return mock or private data:- Inside a job (
SYFT_IS_IN_JOB=true): Returns private data path - Outside a job: Returns mock data path
Usage
Example in Job Code
This is the recommended way to access datasets in job code. It abstracts away the distinction between mock and private data.
bug_report()
Generates a comprehensive environment snapshot for bug reports and debugging.Parameters
If True, return the report as a dictionary instead of printing it
If True, redact user-specific paths in the output for privacy
Returns
If
as_dict=True, returns a dictionary containing all collected info. Otherwise prints the report and returns None.Collected Information
The bug report includes:- Syft Client version and package info
- Runtime environment (Jupyter, Colab, standard Python)
- OS information (platform, version, kernel)
- Hardware details (CPU, RAM, GPU if available)
- Python environment (version, virtual env type)
- Package managers (pip, uv, conda versions)
- Installed packages (syft packages and dependencies)
- Environment interpretation (detected runtime type)
Usage
Example Output
When to Use
Usebug_report() when:
- Reporting issues on GitHub
- Seeking help in discussions
- Debugging environment-specific problems
- Verifying your setup after installation
- Comparing environments across systems
See Also
- Login Functions - Authentication and client creation
- SyftboxManager - Main client interface
- Data Scientist Guide - Using datasets in jobs