Nutstore WebDAV & Python: How to Automate File Workflows

Yes — you can automate file workflows with Python by pointing a general-purpose WebDAV client library at Nutstore’s WebDAV server address, dav.jianguoyun.com/dav/, and authenticating with the WebDAV credentials your account provides. There is no dedicated Nutstore Python SDK, so the library — not a first-party Nutstore tool — does the WebDAV work. This guide walks you through a working WebDAV Python script for uploading and downloading research files, then shows how the same connection serves Zotero, Joplin, and WPS. Two boundaries matter up front: paid users are limited to 1,500 WebDAV requests per 30 minutes, and only saved and uploaded files are available through cloud sync. This is file automation, not code version control.


Prerequisites: What You Need Before You Start

The two most common reasons a WebDAV Python script fails on the first run are a wrong endpoint and the wrong credential type. Fix both before writing a single line of code.

Checklist:

Requirement Detail
Nutstore account Confirm WebDAV access in your own account settings or Nutstore’s current documentation
WebDAV credentials The credential type your account issues for WebDAV access
Server address dav.jianguoyun.com/dav/
Python Python 3 installed, with the ability to run pip install
WebDAV client library This tutorial uses webdavclient3 (webdav3.client)
Optional (Step 9) Zotero, Joplin, or WPS installed

Confirm your Nutstore account. Go to the Nutstore website, create an account, and download the client for your platform. Then verify WebDAV access and your request allowance directly in your account or in Nutstore’s current documentation — availability details can change, so your own account is the authoritative source. Separately, note the published limit: paid users are capped at a maximum of 1,500 WebDAV requests per 30 minutes. Keep that limit in mind as a scripting constraint, not as a statement about who can use WebDAV.

Understand your WebDAV credentials. WebDAV clients authenticate with credentials issued for WebDAV access. Confirm the exact credential type your account provides — and whether app-specific or separate passwords are available — in your account settings or Nutstore’s current documentation. Credential management flows vary, so check rather than assume.

Use this server address: dav.jianguoyun.com/dav/

Pick a library. This tutorial uses webdavclient3 as the single worked example, and every method below is written against it. Other WebDAV libraries exist — easywebdav, or requests with raw WebDAV verbs — but method names and returned values differ by library and version, so you will need to adapt those calls. Be clear on one point: Nutstore does not provide a dedicated Python SDK. You are pointing a general-purpose WebDAV client at Nutstore’s endpoint.

Scope check. This setup automates file handling — documents, research files, and app data. It is not a code version control tool, and Nutstore is not recommended for code sync. If you arrived looking for a Git replacement, this is not it.


Step-by-Step: Automate File Workflows with a WebDAV Python Script

Each step below is written to stand on its own. Every code block that uses a client object repeats the imports, environment-variable reads, and Client configuration it depends on, so you can copy any single step into a fresh file and run it. One exception: the sync_folder script in Step 7 calls the upload_with_retry helper defined in Step 8, so paste both together if you want that step to run as shown.

Step 1 — Confirm your Nutstore account and WebDAV access

Before scripting, open your Nutstore account and confirm that WebDAV access is available and what credential type it provides. Check the same details in Nutstore’s current documentation if anything is unclear. Note separately that the published request ceiling for paid users is 1,500 WebDAV requests per 30 minutes. No code yet — this is a verification step only.

Step 2 — Obtain and store your WebDAV credentials

Locate the WebDAV credentials your account provides and confirm the credential type in your account settings or current documentation. Then store them safely. Never hardcode credentials into a script — anyone who reads the file gets your account. Use environment variables or a local .env file instead.

import os

WEBDAV_USER = os.environ["NUTSTORE_WEBDAV_USER"]
WEBDAV_PASS = os.environ["NUTSTORE_WEBDAV_PASS"]

Set those variables in your shell profile or a .env file that is excluded from any repository you keep.

Step 3 — Install a Python WebDAV client library

pip install webdavclient3

This library wraps the WebDAV verbs — PROPFIND, PUT, GET, MKCOL — so you don’t hand-roll WebDAV XML. It is a third-party library, not a Nutstore SDK. Every method name from here on is a webdavclient3 name; if you use a different library, check its own documentation for equivalents.

Step 4 — Connect to dav.jianguoyun.com/dav/ and verify with a listing call

Configure the client with the Nutstore endpoint, your account username, and your WebDAV credentials, then make one minimal listing call. This block is complete on its own — imports and credential reads included.

import os
from webdav3.client import Client

options = {
    "webdav_hostname": "https://dav.jianguoyun.com/dav/",
    "webdav_login": os.environ["NUTSTORE_WEBDAV_USER"],
    "webdav_password": os.environ["NUTSTORE_WEBDAV_PASS"],
}

client = Client(options)
print(client.list("/"))

Run this first. A successful listing confirms the connection works and that read/list access is available. It does not, on its own, confirm that uploads will succeed — listing and uploading are distinct operations and can fail for different reasons. Test an upload separately in Step 5. Note also that the base URL may require a trailing slash; if the call fails, check the endpoint string first.

Step 5 — Upload a file with a Python WebDAV script

Now put a local file into a target remote path. The remote path is relative to /dav/, so /papers/ in your code means the papers folder inside your Nutstore account. This block is complete on its own.

import os
from webdav3.client import Client

options = {
    "webdav_hostname": "https://dav.jianguoyun.com/dav/",
    "webdav_login": os.environ["NUTSTORE_WEBDAV_USER"],
    "webdav_password": os.environ["NUTSTORE_WEBDAV_PASS"],
}
client = Client(options)

remote_dir = "/papers"
if not client.check(remote_dir):
    client.mkdir(remote_dir)

client.upload_sync(remote_path="/papers/paper.pdf", local_path="./paper.pdf")

Creating the target directory first avoids a failed upload when the folder doesn’t exist. What does “success” mean here? The file is now saved and uploaded — and that is the only state cloud sync can expose. Edits never saved or uploaded are not available through cloud sync, which is why you must save before you script.

Do not assume success from the Step 4 listing. Verify the upload itself. This block is also complete on its own:

import os
from webdav3.client import Client

options = {
    "webdav_hostname": "https://dav.jianguoyun.com/dav/",
    "webdav_login": os.environ["NUTSTORE_WEBDAV_USER"],
    "webdav_password": os.environ["NUTSTORE_WEBDAV_PASS"],
}
client = Client(options)

print(client.list("/papers"))

If the filename appears, the upload landed.

Step 6 — Download and check remote files

Downloading mirrors Step 5 in the other direction. This block is complete on its own.

import os
from webdav3.client import Client

options = {
    "webdav_hostname": "https://dav.jianguoyun.com/dav/",
    "webdav_login": os.environ["NUTSTORE_WEBDAV_USER"],
    "webdav_password": os.environ["NUTSTORE_WEBDAV_PASS"],
}
client = Client(options)

client.download_sync(remote_path="/papers/paper.pdf", local_path="./paper_back.pdf")
print("downloaded ./paper_back.pdf")

This is file automation, not bidirectional delta sync. Nutstore’s Delta Sync is a PC-client feature — your Python script does not trigger it and cannot rely on it. Do not assume that a listing call returns reliable modification timestamps; if you need to compare versions, verify what your library actually returns for the files you care about before depending on it.

Step 7 — Wrap the workflow into a repeatable script

Turn Steps 5 and 6 into one function that walks a local folder including its subfolders, creates the matching remote folders, and uploads only the files that differ from what is already stored. This is the payoff — the manual drag-and-drop step disappears.

First, inspect what your installed library version actually returns. Run these two probes against a file you have already uploaded and read the output before you run the script. This block is complete on its own:

import os
from webdav3.client import Client

options = {
    "webdav_hostname": "https://dav.jianguoyun.com/dav/",
    "webdav_login": os.environ["NUTSTORE_WEBDAV_USER"],
    "webdav_password": os.environ["NUTSTORE_WEBDAV_PASS"],
}
client = Client(options)

print(client.list("/papers"))
print(client.info("/papers/paper.pdf"))

In webdavclient3, client.list() returns a collection of entry names, while client.info(path) returns a dictionary of attributes for a single entry. The exact attribute key names can differ between library versions, so use what the probe prints rather than assuming. The helper below tries the common key names for size and returns None only when the response carries no recognizable size attribute — it does not swallow connection or authentication failures.

import os
from webdav3.client import Client

options = {
    "webdav_hostname": "https://dav.jianguoyun.com/dav/",
    "webdav_login": os.environ["NUTSTORE_WEBDAV_USER"],
    "webdav_password": os.environ["NUTSTORE_WEBDAV_PASS"],
}
client = Client(options)

SIZE_KEYS = ("size", "content_length", "getcontentlength", "contentlength")

def remote_size(client, remote_path):
    """Return the reported remote size, or None when the response carries
    no recognizable size attribute.

    Connection and authentication failures are NOT converted to None here:
    they propagate so the caller can abort instead of uploading blindly.
    """
    info = client.info(remote_path)  # connection/auth errors propagate
    if not isinstance(info, dict):
        return None  # unsupported/opaque response: no size attribute to read
    for key in SIZE_KEYS:
        value = info.get(key)
        try:
            return int(value)
        except (TypeError, ValueError):
            continue
    return None

def sync_folder(client, local_dir, remote_dir):
    if not client.check(remote_dir):
        client.mkdir(remote_dir)

    remote_names = {
        str(entry).rstrip("/").split("/")[-1]
        for entry in client.list(remote_dir)
    }

    for name in sorted(os.listdir(local_dir)):
        local_path = os.path.join(local_dir, name)
        remote_path = f"{remote_dir.rstrip('/')}/{name}"

        if os.path.isdir(local_path):
            sync_folder(client, local_path, remote_path)
            continue
        if not os.path.isfile(local_path):
            continue

        # Only query the server for files that already exist remotely.
        if name in remote_names:
            try:
                rsize = remote_size(client, remote_path)
            except Exception as err:
                # The server check itself failed (connection, auth, etc.).
                # Do NOT treat this as "size unknown" and upload anyway; stop
                # the run so a failed check is never mistaken for a decision.
                print(f"remote check failed for {remote_path}: {err}")
                raise
            if rsize is not None and rsize == os.path.getsize(local_path):
                continue  # same name, same reported size: skip

        # upload_with_retry is defined in Step 8.
        if upload_with_retry(client, remote_path, local_path):
            print(f"uploaded: {remote_path}")
        else:
            print(f"upload failed, skipped: {remote_path}")

sync_folder(client, "./papers", "/papers")

Four things to be precise about, because all four affect whether your remote copy is actually current and how many requests you spend.

Recursion. The function calls itself for every subdirectory and creates the corresponding remote folder before uploading anything inside it, so nested research files — a papers/2026/ tree, for example — are uploaded rather than skipped.

The listing is reused, not repeated. remote_names is built once per directory from a single client.list() call, and it gates the client.info() probe. Files that are not already on the server skip the probe entirely and go straight to upload, which saves one request per new file.

The skip check is a name-and-size comparison, not a content comparison. A file is skipped only when a remote entry of the same name reports the same size. If a local file keeps its size but changes its contents, the size check will not catch it and that file will be skipped. If you need tighter detection, add a modification-time comparison — but only after confirming from the client.info() probe that your library version returns a timestamp you can trust.

A missing size attribute is not the same as a failed check. When remote_size returns None — meaning the response contained no recognizable size key — the function uploads the file instead of skipping it. That is the safe default: it never silently leaves an outdated remote copy behind, but it does cost one upload request per file on every run. If your probe shows the size key differs from the four listed, add that key to SIZE_KEYS so skipping works and your request budget is protected. A genuine connection or authentication failure is handled differently: it raises out of remote_size, is logged, and stops the run, so an upload is never triggered by a check that never actually succeeded.

The upload call is routed through the retry helper. sync_folder no longer calls client.upload_sync directly; it calls upload_with_retry (defined in Step 8) and checks the boolean it returns, so a failed upload is logged as upload failed, skipped and the run continues to the next file instead of crashing. If you prefer a hard stop on the first failure, raise inside the else branch instead of printing.

Skipping unchanged files is not just tidiness — it protects your request budget, which Step 8 explains.

Step 8 — Schedule it and handle failures

Scheduling. Use cron on macOS/Linux and Task Scheduler on Windows. A nightly cron entry at 2:00 AM:

0 2 * * * /usr/bin/python3 /home/me/sync_papers.py >> /home/me/sync.log 2>&1

Failure handling. Design your script to separate errors that are worth retrying from errors that are not. Connection problems are usually transient and worth a retry with a growing delay; authentication problems and malformed paths are not, and retrying them just burns requests. webdavclient3 exposes its exception classes in the webdav3.exceptions module — the example below uses the names commonly found there, but check your installed version’s documentation, because class names can change between releases. This is the helper that sync_folder in Step 7 calls.

import time
from webdav3.exceptions import (
    NotConnection,
    NoConnection,
    WebDavException,
)

def upload_with_retry(client, remote_path, local_path, attempts=3, base_delay=5):
    for attempt in range(1, attempts + 1):
        try:
            client.upload_sync(remote_path=remote_path, local_path=local_path)
            return True
        except (NotConnection, NoConnection) as err:
            print(f"connection error, attempt {attempt}: {err}")
        except WebDavException as err:
            # Non-transient: auth failures, bad paths, missing resources.
            print(f"WebDAV error, not retrying: {err}")
            return False
        if attempt < attempts:
            time.sleep(base_delay * attempt)
    return False

With attempts=3, the helper makes up to three upload attempts and sleeps only between them: it waits 5 seconds before the second attempt and 10 seconds before the third. It does not sleep after the final failed attempt, since there is nothing left to wait for. That growing gap gives a flaky connection time to recover without hammering the server. Because sync_folder now calls this helper and inspects its return value, a failed upload is logged instead of crashing the whole run.

Stay inside the request budget. Respect the 1,500-requests-per-30-minutes limit for paid users. A naive loop over thousands of small files can burn through that budget in seconds, because each file costs at least one request — each remote directory created costs one, each client.list() costs one, and each client.info() probe in the skip check costs one too. Batch where your library allows it, skip unchanged files, and pace your runs rather than firing everything at once. If a run is interrupted by the limit, a retry loop will make it worse, not better — pause and resume later.

Step 9 — Connect the same WebDAV endpoint to Zotero, Joplin, or WPS

dav.jianguoyun.com/dav/ is not Python-specific. The same server address and your account’s WebDAV credentials can be entered in third-party applications — Nutstore’s WebDAV integration is documented with WPS, Zotero, PDF Expert, Notability, Joplin, and Keepass.

One boundary, stated plainly: third-party app autosave and recovery depend on the app, version, device, and settings. Do not assume an app will autosave or recover anything. What is reliable is this: files that sync successfully can be reached from another supported device or the web.

If you are wiring this up for a team rather than yourself, Nutstore’s Team plan is worth a look — it comes with a 20-day free trial: Start the Nutstore Team plan trial.


Troubleshooting Common Nutstore WebDAV Python Errors

Quick answer: If your script fails, check these three things in order. First, verify the endpoint string is exactly dav.jianguoyun.com/dav/ and that you are using the WebDAV credential type your account issues — a wrong credential type is the usual cause of 401 and 403 errors. Second, confirm the remote path you are writing to matches the path you are checking, and re-list the directory to confirm the upload actually landed. Third, account for the paid-user limit of 1,500 WebDAV requests per 30 minutes, which a large folder of small files can exhaust quickly.

The three sections below map each symptom to its cause and its fix.

Authentication fails (401 / 403)

Likely cause: the wrong credential type for WebDAV, or credentials that are no longer valid.
Fix: re-check which credentials your account provides for WebDAV in your account settings or current documentation, re-export the environment variable, confirm the username format the library expects, and retry the Step 4 listing call. Do not put this case in a retry loop — retrying bad credentials only consumes requests.

Requests start failing after a burst of uploads

Likely cause: the limit of 1,500 requests per 30 minutes for paid users.
Fix: confirm this is the cause rather than a network error, then reduce request volume — skip unchanged files, batch where the library allows, and increase the interval between scheduled runs. A script that uploads one file per request consumes the budget quickly on large folders, and each directory creation, each listing, and each client.info() probe in the Step 7 skip check adds another request.

File uploads succeed but the file isn’t visible where expected

Likely cause: the file was written to a different remote path than the one being checked, the local edit was never saved, or you are checking a third-party app whose behavior is app-dependent.
Fix: list the remote directory to confirm the path, save and re-upload the local file, and treat third-party app refresh as dependent on that app’s version, device, and settings rather than on Nutstore.


Frequently Asked Questions

Does Nutstore have a Python SDK?
No. There is no dedicated Nutstore Python SDK. You use a general-purpose WebDAV client library against dav.jianguoyun.com/dav/. This is the single most important expectation to set before you start.

Can I use this Python WebDAV setup for code version control?
No. This automates file handling. Nutstore is not recommended for code sync and is not a version control system. Use it for documents, research files, and app data — not repositories.

What is the WebDAV request limit, and why does it matter for scripting?
The published limit is 1,500 requests per 30 minutes for paid users. It matters because a script that issues one request per file can exceed it on large folders. Design for pacing and skip unchanged files.

Will WebDAV sync my unsaved edits?
No. Only saved and uploaded files are available through cloud sync. An edit still open in an editor, or a file that hasn’t been uploaded, is not reachable from another device or the web.

Can I use the same WebDAV connection for Zotero, Joplin, or WPS?
Yes — the same server address and your account’s WebDAV credentials work in these apps. But autosave and recovery behavior depends on the app, version, device, and settings, so don’t assume identical behavior across tools. If you don’t yet have an account, explore Nutstore here.

Does this work on mobile?
The Python script runs on a computer. Access to synced files from mobile and web is a separate capability, and features can differ by platform — don’t assume every desktop behavior carries over.


Summary: What Your WebDAV Upload Automation Can and Cannot Do

You now have a repeatable WebDAV Python script: point a general-purpose WebDAV client library at dav.jianguoyun.com/dav/ with your account’s WebDAV credentials, and you have removed the manual upload step from your workflow. The same connection reaches Zotero, Joplin, and WPS through the identical endpoint.

Two boundaries to keep in view. First, paid users are limited to 1,500 WebDAV requests per 30 minutes — pace your scripts accordingly. Second, only saved and uploaded files are available through cloud sync; unsaved edits are not. And this remains file automation, not code version control.

If you’re setting this up for a team rather than yourself, Nutstore’s Team plan comes with a 20-day free trial.

Start the Team plan trial: Nutstore Team plan — 20-day free trial
Explore Nutstore: Nutstore main site

Related Posts

Begin typing your search term above and press enter to search. Press ESC to cancel.

Back To Top