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 byhostparameter, or obtained byget_urlsfunction for each file.- Parameters:
- name
str Name of the file to fetch.
- host
str,optional Host name of the server, by default
sftp://example.com/. This value is adaptable from the environment variableSSH_RAYTRACE_HOSTNAME. Host name should be in the format{protocol (e.g. sftp)}://{host's name or ip}/{directories}.- username
str,optional Username to authenticate with the sftp server, by default
username. This value is adaptable from the environment variableSSH_RAYTRACE_USERNAME.- password
str,optional Password to authenticate with the sftp server, by default
password. This value is adaptable from the environment variableSSH_RAYTRACE_PASSWORD.
- name
- Returns:
strPath to the fetched file.