Examples#

The examples in this section show how to use PyHPS Data Transfer to interact in Python with a data transfer service. Each example consists of a Python script plus a data file.

You can use these command-line arguments to execute Python scripts:

  • --local-path: Path to the files or directory to transfer. This argument supports wildcards. The default is None.

  • --remote-path: Optional path to the remote directory to transfer files to. The default is None.

  • --url: HPS URL to connect to. The default is https://localhost:8443/hps.

  • --username: HPS username. The default is repadmin.

  • --password: HPS password. The default is repadmin.

  • --debug: Enable debug logging. The default is no-debug.

Basic usage examples#

These examples show how to use PyHPS Data Transfer to run file operations both synchronously and asynchronously.

Run file operations asynchronously

Run file operations asynchronously

Run file operations synchronously

Run file operations synchronously

Set and query permissions#

This example shows how to set and query permissions on files stored in the remote backend.

Set and query permissions

Set and query permissions

Start PyHPS Data Transfer#

This example shows how to create a data transfer API object using a client and then check for available storages.

Start PyHPS Data Transfer

Start PyHPS Data Transfer

Transfer files using PyHPS Data Transfer#

This example shows some of the main data transfer client calls, like how to transfer files to remote backends, list files on a given path, and download a file from remote backends to local storage.

Transfer files

Transfer files