Skip to main content

CLI tool to backup Supernote note files

Project description

Command line utility to wirelessly backup files from a Supernote device

The primary goal of this project is to create a CLI tool to wirelessly backup files (in particular notes) from a Supernote device to a local computer. It doesn't require a user account, mobile app, or storing notes with third-party cloud providers. Its purpose is to archive device files for storage and safekeeping and doesn't attempt to export or convert notes to another format.

This tool will probably work on any of the Supernote devices running the most up-to-date software. It works by using the builtin Browse & Access feature available on the Supernote device. If Ratta changes how the Browse & Access feature works in future software updates, it is possible this application will break.

Versioned releases are on PyPi but the most up-to-date info is found on Github: snbackup

Setup Process:

  1. Install Python 3.10 or newer along with pip

  2. Setup your Python virtual environment and install with pip install snbackup. You could also use pipx or uv to make it globally available on your system.

  3. Create a folder somewhere on your computer to store your Supernote backups.

  4. IMPORTANT: Create a file called config.json or edit and use the one provided with this project. This file is required to determine where to save your backups and where to access the device on the network. For example, I place my config file in the same directory as my backups.

Example config.json (must contain save_dir and device_url):

{
    "save_dir": "/Users/devin/Documents/Supernote",
    "device_url": "http://192.168.1.105:8089/"
}
  1. Make sure the Supernote device is connected to WiFi with the Browse & Access feature turned on

  2. There are three main ways to run the snbackup tool from your terminal or command line:

    • This will look for the required config.json from step 4 in your current working directory:
      snbackup

    • This optionally specifies the location of the required config.json file:
      snbackup -c /the/path/to/config.json

    • You can also set the environment variable SNBACKUP_CONF which points to the location of the config.json and then run snbackup from any directory without needing to specify the config location.
      export SNBACKUP_CONF="/path/to/config.json"


The snbackup tool will attempt to connect to your device and download all files it finds to the save_dir directory specified in your config.json. The first run may take a few minutes or more as it will attempt to download everything; subsequent runs only download new or modified files.

The tool will make a new directory within your save_dir folder for today and save all files as they are found on the device. For example, if a note titled Ideas is stored within your Stuff folder, it will be backed up locally as /your/chosen/directory/<YYYY-MM-DD>/Note/Stuff/Ideas.note. This example would translate to C:\your\chosen\directory\<YYYY-MM-DD>\Note\Stuff\Ideas.note on a Windows computer.

Everything snbackup does will be printed out to your terminal as well as logged to the snbackup.log file also stored in your save_dir directory.

Helpful Information:

By default, the tool will attempt to backup everything on device. This includes files found in the Document folder, EXPORT folder, SCREENSHOT folder, etc. If you prefer to only download your notes which are found within the device's Note folder, use the command snbackup --notes.

It does not currently attempt to download files from a micro sd card if one has been installed on the Supernote device.

Uploading:

You can also upload files from your local computer with the -u flag to any of the following folders found on the Supernote device: Note, Document, EXPORT, MyStyle, SCREENSHOT, INBOX.

For example, snbackup -u Report.pdf will upload the Report.pdf file to the Document folder by default. The command snbackup -u /path/to/picture.jpg -d MyStyle will upload the picture.jpg file to the destination folder MyStyle.

Additionally, you can specify multiple files at once separated by a space:
snbackup -u file1 file2 file3

If no destination is specified after the -d flag the device Document folder is used.

The accepted file formats for the upload are .note, .pdf, epub, .docx, .doc, .txt, .png, .jpg, .jpeg, .bmp, .webp, .cbz, .fb2, .xps, .mobi

Additional Options:

  • Show all available command line options:
    snbackup -h

  • Inspect new files to be downloaded from device and but do not download:
    snbackup -i

  • The full backup flag will ignore previously saved backups and force the tool to redownload everything from device:
    snbackup -f

  • Remove all but the specified number of backups from your local backup directory. This example will keep only the 5 most recent backups and delete any older ones:
    snbackup --cleanup 5

  • Print program version:
    snbackup -v


There are additional configuration options that can be set in the config.json file.

{
    "save_dir": "/Users/devin/Documents/Supernote",
    "device_url": "http://192.168.1.105:8089/"
    "num_backups": 7,
    "cleanup": true,
    "truncate_log": 500
}

In addition to the two required save_dir and device_url keys, this example config keeps only the 7 most recent backups and also prevents the program's log file from exceeding 500 lines. With num_backups and cleanup both set, the cleanup process will run automatically, and the --cleanup flag no longer needs to be specified.

By default the snbackup.log file only keeps the last 1000 lines. This number can be adjusted in the config.json file.

Tips:

  • If your Supernote device's IP address changes often on your local network, consider assigning it a static IP address. This can typically be done by logging into your router and configuring it there.

  • Windows systems use the backslash character \ as a separator for file paths. This is tricky for JSON files. Luckily, you can still use forward slashes / as shown in the example config.json even on Windows. However, you can also escape the backslashes if you prefer. For example your save_dir might look something like this "C:\\Users\\devin\\My Documents\\Supernote" on a Windows computer.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

snbackup-2.0.2.tar.gz (20.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

snbackup-2.0.2-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file snbackup-2.0.2.tar.gz.

File metadata

  • Download URL: snbackup-2.0.2.tar.gz
  • Upload date:
  • Size: 20.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for snbackup-2.0.2.tar.gz
Algorithm Hash digest
SHA256 26b0107a7bdd725c2b2b263fd53cf4a2ea018e185dbfb2338a1d7cf778c404d2
MD5 a0ccdc6ec380aa17f1ab6fca040b9675
BLAKE2b-256 9d53e7baf36c0d7ea327407cf50370fcdcbbfee593dfc1c0162b4ece5c8d7a78

See more details on using hashes here.

File details

Details for the file snbackup-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: snbackup-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for snbackup-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 51c6111c40670f5f5057f8550fabecabf117425c3bcb8dcab00dd0017fdcedd4
MD5 af88c4746535fc0c3be9a6068ead9756
BLAKE2b-256 7fd8fc20e02b60fb8c4a0e24e3a65d85a9ba0a9839b0092124c83c7312bcf6f8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page