fetch_file#

cherab.lhd.tools.fetch.fetch_file(name: str, host: str = 'sftp://example.com/', username: str = 'username', password: str = 'password') strSource#

Fetch the file from the remote server using the configured SFTP downloader.

Fetched data will be stored in the cache directory like cache/cherab/lhd.

Parameters:
namestr

Name of the file to fetch.

hoststr, optional

Host name of the server, by default sftp://example.com/. This value is adaptable from the environment variable SSH_RAYTRACE_HOSTNAME. Host name should be in the format sftp://{host's name or ip}/{directories}.

usernamestr, optional

Username to authenticate with the server, by default username. This value is adaptable from the environment variable SSH_RAYTRACE_USERNAME.

passwordstr, optional

Password to authenticate with the server, by default password. This value is adaptable from the environment variable SSH_RAYTRACE_PASSWORD.

Returns:
str

Path to the fetched file.