nuFS documentation
Set up a client, work with files and read earlier versions. Browse the topics in the sidebar or search any method, command, endpoint or field.
Your first file
Choose a drive. Create a drive-scoped access key in the web app, then use its REST bearer token below.
export NUFS_ENDPOINT='https://api.example.test'
export NUFS_TOKEN='REPLACE_WITH_REST_BEARER'
export NUFS_DRIVE_ID='REPLACE_WITH_DRIVE_ID'Install the supplied Python release artifact:
python -m pip install /path/to/nufs_sdk-0.2.0-py3-none-any.whlCreate a file, save its contents, make an edit and read the result:
import os
import uuid
from nufs_sdk import Client
with Client(os.environ["NUFS_ENDPOINT"], os.environ["NUFS_TOKEN"]) as client:
file = client.create_entry(os.environ["NUFS_DRIVE_ID"],
"notes-" + uuid.uuid4().hex + ".txt", "file")
first = client.write_file(file["id"], b"hello", None)
saved = client.write_at(file["id"], 0, b"H", first["version"]["id"])
original = client.read_version_range(file["id"], saved["version"]["id"], 0, 5)
assert original == b"Hello"
print(client.versions(file["id"]))