Skip to main content

Build Status Coverage Status

Synapse Uploader

Utility to upload a directory and files to Synapse.

Dependencies

  • Python3
  • A Synapse account with a username/password. Authentication through a 3rd party (.e.g., Google) will not work, you must have a Synapse user/pass for the API to authenticate.

Install

pip install synapse-uploader

Configuration

Your Synapse credentials can be provided on the command line (--username, --password) or via environment variables.

SYNAPSE_USERNAME=your-synapse-username
SYNAPSE_PASSWORD=your-synapse-password

Usage

usage: synapse-uploader [-h] [--version] [-r REMOTE_FOLDER_PATH] [-d DEPTH]
                        [-t THREADS] [-u USERNAME] [-p PASSWORD]
                        [-ll LOG_LEVEL] [-ld LOG_DIR] [-f] [-cd CACHE_DIR]
                        entity-id local-path

positional arguments:
  entity-id             Synapse entity ID to upload to (e.g., syn123456789).
  local-path            Path of the directory or file to upload.

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  -r REMOTE_FOLDER_PATH, --remote-folder-path REMOTE_FOLDER_PATH
                        Folder to upload to in Synapse.
  -d DEPTH, --depth DEPTH
                        The maximum number of child folders or files under a
                        Synapse Project/Folder.
  -t THREADS, --threads THREADS
                        The maximum number of threads to use.
  -u USERNAME, --username USERNAME
                        Synapse username.
  -p PASSWORD, --password PASSWORD
                        Synapse password.
  -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.
  -f, --force-upload    Force files to be re-uploaded. This will clear the
                        local Synapse cache and increment each file's version.
  -cd CACHE_DIR, --cache-dir CACHE_DIR
                        Set the directory where the Synapse cache will be
                        stored.

Examples

Upload all the folders and files in ~/my_study to your Project ID syn123456:

  • Linux: synapse-uploader syn123456 ~/my_study
  • Windows: synapse-uploader syn123456 %USERPROFILE%\my_study

Upload all the folders and files in ~/my_study to your Project ID syn123456 in the drafts/my_study folder:

  • Linux: synapse-uploader syn123456 ~/my_study -r drafts/my_study
  • Windows: synapse-uploader syn123456 %USERPROFILE%\my_study -r drafts\my_study

Note: The correct path separator (\ for Windows and / for Linux) must be used in both the local-folder-path and the remote-folder-path.

Development Setup

pipenv --three
pipenv shell
make pip_install
make build
make install_local

See Makefile for all commands.

Testing

  • Create and activate a virtual environment:
  • Copy private.test.env.json to the tests directory and set each of the variables.
  • Run the tests: make test

Metadata

Release files for synapse-uploader 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for synapse-uploader 0.0.6
File Size Uploaded Provenance Actions
synapse-uploader-0.0.6.tar.gz 15.3 kB Without provenance Details for synapse-uploader-0.0.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for synapse-uploader 0.0.6
File Interpreter ABI Platform Actions
synapse_uploader-0.0.6-py2.py3-none-any.whl Python 2, Python 3 none any Details for synapse_uploader-0.0.6-py2.py3-none-any.whl

Total release size: 28.7 kB

Release files / synapse-uploader-0.0.6.tar.gz

Download URL synapse-uploader-0.0.6.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
05f449e96cb6ae98404e466052593bc714c0babf4ba5714619a1848fd5b61530
BLAKE2b-256 checksum
How to use checksums
7b80cc854641b5df87c25a3bf097dbfa8d2d1b4dea7f1ceadac74d64bb4386e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / synapse_uploader-0.0.6-py2.py3-none-any.whl

Download URL synapse_uploader-0.0.6-py2.py3-none-any.whl
Size 13.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
7719ee1f51dbef291febc8d0376eeef209b3883254f2d84fd9ce3134595a9358
BLAKE2b-256 checksum
How to use checksums
257d827ecfdc5266b5b40410ecbac11a397d3e4c56a218100af8181b59abf038
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Security for synapse-uploader 0.0.6

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page