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 remotely.

Fetched data will be stored in the cache directory like cache/cherab/lhd. The download destination (URL) is specified by host parameter, or obtained by get_urls function for each file.

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 {protocol (e.g. sftp)}://{host's name or ip}/{directories}.

usernamestr, optional

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

passwordstr, optional

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

Returns:
str

Path to the fetched file.