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 your local computer. I have no interest in making user accounts, using mobile apps, or storing my notes with third-party cloud providers.
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 cli tool will break.
Versioned releases are on PyPi but the most up-to-date info is found on Github: snbackup
Setup Process:
-
Install Python 3.10 or newer along with pip
-
Setup your Python virtual environment and install with
pip install snbackup. My preference is to install withpipxwhich makes the tool globally available. -
Create a folder somehwere on your computer to store your Supernote backups.
-
IMPORTANT: Create a file called
config.jsonor 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:
{
"save_dir": "/Users/devin/Documents/Supernote",
"device_url": "http://192.168.1.105:8089/"
}
-
Make sure the Supernote device is connected to WiFi with the Browse & Access feature turned on
-
There are three main ways to run the
snbackuptool 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_CONFwhich points to the location of the config.json.
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 device 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.
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 device's MyStyle folder.
Additionally, you can specify multiple files at once separated by a space inbetween:
snbackup -u file1 file2 fil3
Additonal Options:
-
Show all available command line options:
snbackup -h -
Inspect and show new files to be downloaded from device and quit without downloading:
snbackup -i -
The full backup flag will ignore previously saved backups and will force the tool to download all files from device
snbackup -f -
Remove all but the specified number of backups from your local backup directory. This example will keep only the last 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 additon 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 log file from exceeding 500 lines. With these set, the cleanup process will happen automatically each time the tool runs, and the --cleanup flag no longer needs to be specified on the command line.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file snbackup-2.0.0.tar.gz.
File metadata
- Download URL: snbackup-2.0.0.tar.gz
- Upload date:
- Size: 20.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de41966d5fb355df42c64c3e54fe60ea42280f37687963c7b1b66417d883232d
|
|
| MD5 |
b2a85d0eb1ebb4b6544f830b4a966872
|
|
| BLAKE2b-256 |
c41560cb81458f37ac3403f268869dc476a4e8e9ac97dde1ecb3bfc33623c21a
|
File details
Details for the file snbackup-2.0.0-py3-none-any.whl.
File metadata
- Download URL: snbackup-2.0.0-py3-none-any.whl
- Upload date:
- Size: 15.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5290355d3543e3c38fd1a025ac0f5a19cd5f6106b081547aa78241324415cce2
|
|
| MD5 |
5fa26e70ce9c47124585733e8b7b5a1a
|
|
| BLAKE2b-256 |
85fcbe5c75e909fd78e7ac350d7772a98277d02c0ac2dd0f551c219f6fbffa6b
|