Tools for exporting Synology Office files from Synology NAS devices
Project description
Synology Office Exporter
This tool downloads Synology Office files from your Synology NAS and converts them to Microsoft Office formats. It processes Synology Office documents from your personal My Drive, team folders, and shared files, converting them to their corresponding Microsoft Office formats.
File Conversion Types
- Synology Spreadsheet (
.osheet) → Microsoft Excel (.xlsx) - Synology Document (
.odoc) → Microsoft Word (.docx) - Synology Slides (
.oslides) → Microsoft PowerPoint (.pptx)
Requirements
- Python 3.6+
- synology-drive-api package
- python-dotenv package
Installation
Clone the Repository
git clone https://github.com/isseis/synology-office-exporter.git
cd synology-office-exporter
Create virtual environment
It's recommended to create Python virtual environment and run the tools inside it.
For bash / zsh users:
python -m venv .venv
. .venv/bin/activate
pip install --upgrade pip
Mac users
In case you encounter error message like zsh: command not found: python, you should run python3 -m venv .venv instead of python -m venv .venv in the commands above.
Using pyproject.toml
The project includes a pyproject.toml file for modern Python packaging. You can:
Build and install the package
pip install .
After installation, you can run the tool using the command:
synology-office-exporter --help
Development
You may skip this section if you just want to use this tool.
Install development packages
pip install -e '.[dev]'
This installs packages used for development, and install this project in editable mode.
Setting up pre-commit hooks
Install the pre-commit hooks:
pre-commit install
Now, every time you run git commit, the following actions will be performed automatically:
- Basic checks (trailing whitespaces, file endings, etc.)
- Linting with flake8
- Running all tests
If any of these checks fail, the commit will be aborted.
To manually run all hooks on all files:
pre-commit run --all-files
To skip pre-commit hooks for a specific commit (not recommended for normal workflow):
git commit --no-verify
Running Tests
To run the tests manually:
make test
or
python -m unittest discover -s tests -p 'test_*.py'
Linting
To check code style with flake8:
make lint
or
flake8 --config .flake8
Running Tests
To run the tests manually:
make test
or
python -m unittest discover -s tests -p 'test_*.py'
Configuration
Create a .env file and set the following environment variables:
SYNOLOGY_NAS_USER=your_username
SYNOLOGY_NAS_PASS=your_password
SYNOLOGY_NAS_HOST=your_nas_ip_or_hostname
Usage
Command Line
python -m synology_office_exporter.main [options]
Or if installed:
synology-office-exporter [options]
Options
-o, --output DIR- Directory to save files (default: current directory)-u, --username USER- Synology username-p, --password PASS- Synology password-s, --server HOST- Synology server URL-f, --force- Force download all files, ignoring download history--log-level LEVEL- Set log level (default: info)- Choices: debug, info, warning, error, critical
-h, --help- Show help message
Authentication
Authentication can be provided in three ways (in order of priority):
- Command line arguments (-u, -p, -s)
- Environment variables (via .env file: SYNOLOGY_NAS_USER, SYNOLOGY_NAS_PASS, SYNOLOGY_NAS_HOST)
- Interactive prompt
Using Makefile
make run ARGS="-f --log-level debug"
By default, files are saved in the out directory (specified in the Makefile).
Features
- Connects to Synology NAS and downloads Synology Office files from My Drive, team folders, and shared files
- Saves files to the specified output directory while preserving directory structure
- Tracks download history to avoid re-downloading unchanged files (can be overridden with the
--forceoption) - Automatically skips encrypted files (as they cannot be converted automatically)
Notes
- This tool uses the Synology Drive API to access files.
- If you have a large number of files, the initial run may take some time.
- Subsequent runs will only download changed files (unless the
--forceoption is used).
Troubleshooting
Runtime Errors
ModuleNotFoundError: Ensure the required packages are installed correctly.- Connection errors: Check the NAS IP address and port settings. The default ports are 5000 for HTTP and 5001 for HTTPS.
SSL: CERTIFICATE_VERIFY_FAILED: Ensure the NAS has a valid SSL certificate or use the--no-verifyoption to skip SSL verification.
Acknowledgements
- Synology Drive API - Used for communication with the Synology Drive API
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
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 synology_office_exporter-0.0.2.tar.gz.
File metadata
- Download URL: synology_office_exporter-0.0.2.tar.gz
- Upload date:
- Size: 15.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6954ddbe91052f1d344a21dc87925d5aec3a69432f62bb8a8d4c4ca5adcdc1f
|
|
| MD5 |
e0d3fb10f0fefa56b816b47607432a44
|
|
| BLAKE2b-256 |
857e7c2b13683f0aab075f6ac1f138c159d2fc4560939b757bdc123561d2ade9
|
Provenance
The following attestation bundles were made for synology_office_exporter-0.0.2.tar.gz:
Publisher:
ci-cd.yml on isseis/synology-office-exporter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
synology_office_exporter-0.0.2.tar.gz -
Subject digest:
e6954ddbe91052f1d344a21dc87925d5aec3a69432f62bb8a8d4c4ca5adcdc1f - Sigstore transparency entry: 185449279
- Sigstore integration time:
-
Permalink:
isseis/synology-office-exporter@a3e6d8997fd4ebb933bf14814be41a80ff99a305 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/isseis
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci-cd.yml@a3e6d8997fd4ebb933bf14814be41a80ff99a305 -
Trigger Event:
push
-
Statement type:
File details
Details for the file synology_office_exporter-0.0.2-py3-none-any.whl.
File metadata
- Download URL: synology_office_exporter-0.0.2-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91e4b5962be830e5eb2c47bcfdcf464c5ed74f6a1fe2231ec16127aabefe2ef3
|
|
| MD5 |
35b13d8f2bedd45183a456a96072b432
|
|
| BLAKE2b-256 |
8d789c5121830008a75bba2e9002e6567f3f642675d646ac01ef25371320e6c3
|
Provenance
The following attestation bundles were made for synology_office_exporter-0.0.2-py3-none-any.whl:
Publisher:
ci-cd.yml on isseis/synology-office-exporter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
synology_office_exporter-0.0.2-py3-none-any.whl -
Subject digest:
91e4b5962be830e5eb2c47bcfdcf464c5ed74f6a1fe2231ec16127aabefe2ef3 - Sigstore transparency entry: 185449283
- Sigstore integration time:
-
Permalink:
isseis/synology-office-exporter@a3e6d8997fd4ebb933bf14814be41a80ff99a305 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/isseis
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci-cd.yml@a3e6d8997fd4ebb933bf14814be41a80ff99a305 -
Trigger Event:
push
-
Statement type: