Skip to content

Daserym/PySynClient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PySynClient

Automatically detects Synology Drive Client sync folders on Windows and provides stable, device-independent access to their local paths.

Unlike the Synology Drive Client's internal numeric indices (which can shift between machines or when NAS connections change), PySynClient keys everything by NAS hostname and share name — identifiers that stay consistent across devices.

Installation

pip install pysynclient

Usage

Get sync folder paths

import pysynclient

paths = pysynclient.get_server_paths()
# {
#     "my-nas": {
#         "home": Path("D:/SynologyDrive/home"),
#         "datasets": Path("D:/SynologyDrive/datasets"),
#         "photos": Path("D:/SynologyDrive/photos"),
#     }
# }

# Access a specific folder
datasets = paths["my-nas"]["datasets"]

List connected NAS systems

hosts = pysynclient.get_nas_hosts()
# ["my-nas"]

Get detailed connection info

info = pysynclient.get_connection_info()
# {
#     "my-nas": {
#         "host_name": "my-nas",
#         "server_name": "my-nas.example.com",
#         "server_ip": "10.0.0.1",
#         "username": "admin",
#     }
# }

Example: Building a cross-device file path

import pysynclient

paths = pysynclient.get_server_paths()

# Works on any machine connected to this NAS — no hardcoded paths
model_weights = paths["my-nas"]["datasets"] / "models" / "weights.pt"

Requirements

  • Windows (Synology Drive Client stores its data in %LOCALAPPDATA%)
  • Synology Drive Client installed and connected to at least one NAS
  • Python >= 3.10

About

Automatically detects the location of the synology drive client folders and returns its parent location

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages