Synapse Downloader
Utility for downloading large datasets from Synapse.
Dependencies
- Python3.10+
- A Synapse account with an auth token.
Install
pip install synapse-downloader
Configuration
Environment Variables
No configuration is necessary if using environment variables or the default synapse config file.
For user/pass, set:
SYNAPSE_USERNAME=
SYNAPSE_PASSWORD=
For auth token, set:
SYNAPSE_AUTH_TOKEN=
For Synapse Config file:
Have a valid config file in: ~/.synapseConfig
Or, have the environment variable set: SYNAPSE_CONFIG_FILE=
Command Line Arguments
options:
-u USERNAME, --username USERNAME
Synapse username.
-p PASSWORD, --password PASSWORD
Synapse password.
--auth-token AUTH_TOKEN
Synapse auth token.
--synapse-config SYNAPSE_CONFIG
Path to Synapse configuration file.
Usage
usage: synapse-downloader [-h] [--version] {download,compare,sync-from-synapse} ...
Synapse Downloader
options:
-h, --help show this help message and exit
--version show program's version number and exit
Commands:
{download,compare,sync-from-synapse}
download Download items from Synapse to a local directory. Default command.
compare Compare items in Synapse to a local directory.
sync-from-synapse Download items from Synapse to a local directory using the syncFromSynapse method.
Download
usage: synapse-downloader download [-h] [-u USERNAME] [-p PASSWORD] [--auth-token AUTH_TOKEN]
[--synapse-config SYNAPSE_CONFIG] [-ll LOG_LEVEL] [-ld LOG_DIR] [-e [EXCLUDE]] [-wc]
entity-id local-path
positional arguments:
entity-id The ID of the Synapse entity to download (Project, Folder or File).
local-path The local path to save the files to.
options:
-h, --help show this help message and exit
-u USERNAME, --username USERNAME
Synapse username.
-p PASSWORD, --password PASSWORD
Synapse password.
--auth-token AUTH_TOKEN
Synapse auth token.
--synapse-config SYNAPSE_CONFIG
Path to Synapse configuration file.
-ll LOG_LEVEL, --log-level LOG_LEVEL
Set the logging level.
-ld LOG_DIR, --log-dir LOG_DIR
Set the directory where the log file will be written.
-e [EXCLUDE], --exclude [EXCLUDE]
Items to exclude from download. Synapse IDs, names, or filenames (names are case-sensitive).
-wc, --with-compare Run compare after downloading everything.
Compare
usage: synapse-downloader compare [-h] [-u USERNAME] [-p PASSWORD] [--auth-token AUTH_TOKEN] [--synapse-config SYNAPSE_CONFIG]
[-ll LOG_LEVEL] [-ld LOG_DIR] [-e [EXCLUDE]]
entity-id local-path
positional arguments:
entity-id The ID of the Synapse entity to compare (Project, Folder or File).
local-path The local path to compare.
options:
-h, --help show this help message and exit
-u USERNAME, --username USERNAME
Synapse username.
-p PASSWORD, --password PASSWORD
Synapse password.
--auth-token AUTH_TOKEN
Synapse auth token.
--synapse-config SYNAPSE_CONFIG
Path to Synapse configuration file.
-ll LOG_LEVEL, --log-level LOG_LEVEL
Set the logging level.
-ld LOG_DIR, --log-dir LOG_DIR
Set the directory where the log file will be written.
-e [EXCLUDE], --exclude [EXCLUDE]
Items to exclude from compare. Synapse IDs, names, or filenames (names are case-sensitive).
Sync From Synapse
usage: synapse-downloader sync-from-synapse [-h] [-u USERNAME] [-p PASSWORD] [--auth-token AUTH_TOKEN]
[--synapse-config SYNAPSE_CONFIG] [-ll LOG_LEVEL] [-ld LOG_DIR]
entity-id local-path
positional arguments:
entity-id The ID of the Synapse entity to download (Project, Folder or File).
local-path The local path to save the files to.
options:
-h, --help show this help message and exit
-u USERNAME, --username USERNAME
Synapse username.
-p PASSWORD, --password PASSWORD
Synapse password.
--auth-token AUTH_TOKEN
Synapse auth token.
--synapse-config SYNAPSE_CONFIG
Path to Synapse configuration file.
-ll LOG_LEVEL, --log-level LOG_LEVEL
Set the logging level.
-ld LOG_DIR, --log-dir LOG_DIR
Set the directory where the log file will be written.
Development Setup
pipenv --python 3.10
pipenv shell
make pip_install
make build
make install_local
See Makefile for all commands.
Run tests:
- Rename
.env.templateto.envand set the variables in the file. - Run
make testortox
Metadata
Release files for synapse-downloader 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| synapse-downloader-0.2.0.tar.gz | 17.0 kB | Without provenance | Details for synapse-downloader-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| synapse_downloader-0.2.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for synapse_downloader-0.2.0-py2.py3-none-any.whl |
Total release size: 37.0 kB
Release files / synapse-downloader-0.2.0.tar.gz
| Download URL | synapse-downloader-0.2.0.tar.gz |
|---|---|
| Size | 17.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
437b79058ffdf46c0f6c451a4082a3a589c051ed256ea4365c7d33bde7aea8e1
|
|
BLAKE2b-256 checksum How to use checksums |
8d5409fd08b0eeac57f353c3b5dd184d2d75ba0dd3e314740725e9df17b7b473
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Release files / synapse_downloader-0.2.0-py2.py3-none-any.whl
| Download URL | synapse_downloader-0.2.0-py2.py3-none-any.whl |
|---|---|
| Size | 20.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
0f07b4ec9068637a1f5372460df52b2dbb4300fee9edffd0b05d9d5293e8897c
|
|
BLAKE2b-256 checksum How to use checksums |
c246f17305de386783451fad6d21d8756b924cc34ad43a87c82aa47c1949c0f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Security for synapse-downloader 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.