Examples#

The examples in this section show how to use PyHPS Data Transfer to interact with data transfer service in Python. Each example consists of a Python script plus a data file. You can execute many Python scripts with these command-line arguments:

  • --local-path: Path to the files or directory to transfer. Supports wildcards (default: None) [required]

  • --remote-path: Optional path to the remote directory to transfer files to (default: None)

  • --url: HPS URL to connect to [default: https://localhost:8443/hps]

  • --username: HPS username (default: repadmin)

  • --password: HPS password (default: repadmin)

  • --debug: Enable debug logging [default: no-debug]

Basic usage examples#

These examples show how to use PyHPS Data Transfer for file operations and how to set up and use a asynchronous client for data transfer operations

Run Async

Run Async

File Operations

File Operations

Set and query permissions#

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

Set and query permissions

Set and query permissions

Startup PyHPS Data Transfer#

This example demonstrates how to create a data transfer api object using a client and check for available storages.

Startup PyHPS Data Transfer

Startup 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 how to download file from remote backends onto local storage.

Basic script to transfer files

Basic script to transfer files