API

RemoteFiles.RemoteFileMethod
RemoteFile(uri::URI; kwargs...)

Create a RemoteFile instance with location url.

The following keyword arguments are available:

  • file: Set a different local file name.
  • dir: The download directory. If dir is not set RemoteFiles will create a new directory data in the current directory, i.e. at pwd().
  • updates (default: :never): Indicates with which frequency the remote file is updated. Possible values are:
    • :never
    • :daily
    • :monthly
    • :yearly
    • :mondays/:weekly, :tuesdays, etc.
  • retries (default: 3): How many retries should be attempted.
  • try_backends (default: true): Whether to retry with different backends.
  • wait (default: 5): How many seconds to wait between retries.
  • failed (default: :error): What to do if the download fails. Either throw an exception (:error) or display a warning (:warn).

Note: the difference to @RemoteFile is that the default directory data is created in pwd() as opposed to a under the root of the current package.

source
RemoteFiles.RemoteFileSetMethod
RemoteFileSet("Some description",
              file1 = RemoteFile(...) # or @RemoteFile ...
              file2 = RemoteFile(...)
              )

Collect several RemoteFiles in the RemoteFileSet with a description.

source
Base.Filesystem.rmMethod
rm(rfs::RemoteFileSet, file; force=false)

Remove a specific downloaded file contained in rfs.

source
Base.downloadMethod
download(rfs::RemoteFileSet;
    quiet::Bool=false, verbose::Bool=false, force::Bool=false)

Download all files contained in rfs.

  • quiet: Do not print messages.
  • verbose: Print all messages.
  • force: Force download and overwrite existing files.
  • force_update: Overwrite existing files even if they are equal.
source
Base.downloadMethod
download(rf::RemoteFile;
         quiet::Bool=false,
         verbose::Bool=false,
         force::Bool=false,
         retries::Int=0)

Download rf.

  • quiet: Do not print messages.
  • verbose: Print all messages.
  • force: Force download and overwrite existing files.
  • force_update: Overwrite existing files even if they are equal.
  • retries: Override the number of retries in rf if retries != 0
source
FileIO.loadMethod
load(rf::RemoteFile)

Load the contents of a remote file, downloading the file if it has not been done previously, reading the file from disk and trying to infer the format from filename and/or magic bytes in the file via FileIO.jl.

source
RemoteFiles.filesMethod
files(rfs::RemoteFileSet)

Get the (unsorted) list of file identifiers from a RemoteFileSet.

source
RemoteFiles.pathMethod
path(rfs::RemoteFileSet, file)

Get the path to a specific downloaded file contained in rfs.

source
RemoteFiles.pathsMethod
paths(rfs::RemoteFileSet, files...)

Get the paths to specific downloaded files contained in rfs.

source
[email protected]Macro
@RemoteFile name url [key=value...]

Assign the RemoteFile located at url to the variable name.

The following keyword arguments are available:

  • file: Set a different local file name.
  • dir: The download directory. If dir is not set RemoteFiles will create a new directory data under the root of the current package and save the file there.
  • updates (default: :never): Indicates with which frequency the remote file is updated. Possible values are:
    • :never
    • :daily
    • :monthly
    • :yearly
    • :mondays/:weekly, :tuesdays, etc.
  • retries (default: 3): How many retries should be attempted.
  • try_backends (default: true): Whether to retry with different backends.
  • backends (default RemoteFiles.BACKENDS): Which backends to try.
  • wait (default: 5): How many seconds to wait between retries.
  • failed (default: :error): What to do if the download fails. Either throw an exception (:error) or display a warning (:warn).
source
[email protected]Macro
@RemoteFileSet name description begin
    file1 = @RemoteFile ...
    file2 = @RemoteFile ...
    ...
end

Collect several RemoteFiles in the RemoteFileSet saved under name with a description.

source