Metadata-Version: 2.3
Name: supernote-sync
Version: 0.2.3
Summary: Automatically sync Supernote notebooks and convert to PDF on local WiFi
License: Apache-2.0
Author: Jerome Boisvert-Chouinard
Author-email: github@jbchouinard.net
Requires-Python: >=3.9,<4
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: loguru (>=0.7.3,<0.8.0)
Requires-Dist: pydantic (>=2.11.7,<3.0.0)
Requires-Dist: pydantic-settings (>=2.10.1,<3.0.0)
Requires-Dist: reportlab (>=4.4.2,<5.0.0)
Requires-Dist: requests (>=2.32.4,<3.0.0)
Requires-Dist: sqlalchemy (>=2.0.41,<3.0.0)
Requires-Dist: supernotelib (>=0.6.2,<0.7.0)
Requires-Dist: tabulate (>=0.9.0,<0.10.0)
Project-URL: Homepage, https://github.com/jbchouinard/supernote-sync
Project-URL: Issues, https://github.com/jbchouinard/supernote-sync/issues
Project-URL: Repository, https://github.com/jbchouinard/supernote-sync
Description-Content-Type: text/markdown

# supernote-sync

An unofficial tool for [Supernote](https://supernote.com/) e-Ink notebooks, for syncing files locally and automatically converting notebooks to PDF.

The program uses the [Supernote Browse & Access](https://support.supernote.com/Tools-Features/wi-fi-transfer) feature to synchronize files. It must run on the same local network as the Supernote device.

By default, `supernote-sync` syncs the INBOX directory in push mode, and all other directories in pull mode.


## Usage

### Install and run with pipx

```sh
pipx install supernote-sync
supernote-sync --supernote-url=http://xxx.xxx.xxx.xxx:8089 --supernote-device-name="Change To Your Device Name" --sync-dir=path/to/dir/to/sync start
```

### Run with Docker

```sh
docker run \ 
    -e SUPERNOTE_URL="http://xxx.xxx.xxx.xxx:8089" \
    -e SUPERNOTE_DEVICE_NAME="Change To Your Device Name" \
    -v path/to/dir/to/sync:/supernote \
    ghcr.io/jbchouinard/supernote-sync:latest
```

### Build Docker image

```sh
docker build -t supernote-sync .
```

## Configuration

Configuration options can be set by environment variables or command line arguments.

### Supernote Connection Settings

WiFi transfer must be toggled on on the Supernote device. The popup will show the URL of the device.

| Option | Environment Variable | CLI Argument | Description | Default |
|--------|---------------------|-------------|-------------|--------|
| `supernote_url` | `SUPERNOTE_URL` | `--supernote-url` | URL of your Supernote device | *Required* |
| `supernote_device_name` | `SUPERNOTE_DEVICE_NAME` | `--supernote-device-name` | Name of your Supernote device | *Required* |

### Sync Settings

| Option | Environment Variable | CLI Argument | Description | Default |
|--------|---------------------|-------------|-------------|--------|
| `push_dirs` | `PUSH_DIRS` | `--push-dirs` | Directories to push files to (comma-separated) | `INBOX` |
| `pull_dirs` | `PULL_DIRS` | `--pull-dirs` | Directories to pull files from (comma-separated) | `Note,Document,MyStyle,EXPORT,SCREENSHOT` |
| `sync_extensions` | `SYNC_EXTENSIONS` | `--sync-extensions` | File extensions to sync (comma-separated) | `note,spd,spd-shm,spd-wal,pdf,epub,doc,txt,png,jpg,jpeg,webp` |
| `sync_interval` | `SYNC_INTERVAL` | `--sync-interval` | Sync interval in seconds | `60` |
| `sync_dir` | `SYNC_DIR` | `--sync-dir` | Local directory for synced files | `supernote/sync` |
| `trash_dir` | `TRASH_DIR` | `--trash-dir` | Local directory for deleted files - permanently deleted if unset | `supernote/trash` |

### Database Settings

By default, uses a local SQLite database. Can use any database supported by SQLAlchemy.

| Option | Environment Variable | CLI Argument | Description | Default |
|--------|---------------------|-------------|-------------|--------|
| `db_url` | `DB_URL` | `--db-url` | Database connection URL | `sqlite:///supernote/db.sqlite` |

### PDF Conversion Settings

Configure automatic conversion of notebooks to PDF when syncing.

To match the notebook, the page size is A5 for the Manta, or A4 for the Nomad.

| Option | Environment Variable | CLI Argument | Description | Default |
|--------|---------------------|-------------|-------------|--------|
| `convert_to_pdf` | `CONVERT_TO_PDF` | `--convert-to-pdf` | Convert Supernote files to PDF | `False` |
| `force_reconvert` | `FORCE_RECONVERT` | `--force-reconvert` | Force reconversion of already converted files | `False` |
| `pdf_page_size` | `PDF_PAGE_SIZE` | `--pdf-page-size` | PDF page size | `A5` |
| `pdf_vectorize` | `PDF_VECTORIZE` | `--pdf-vectorize` | Vectorize notebooks when converting to PDF | `False` |

### Logging Settings

| Option | Environment Variable | CLI Argument | Description | Default |
|--------|---------------------|-------------|-------------|--------|
| `log_file` | `LOG_FILE` | `--log-file` | Log file path | None (logs to console) |
| `log_level` | `LOG_LEVEL` | `--log-level` | Logging level | `WARNING` |

