Title: Simplifies Access to Cloudstor API
Version: 0.2.0
Description: Access Cloudstor via their WebDAV API. This package can read, write, and navigate Cloudstor from R.
URL: https://pdparker.github.io/cloudstoR/, https://github.com/pdparker/cloudstoR
BugReports: https://github.com/pdparker/cloudstoR/issues
License: GPL (≥ 3)
Suggests: rstudioapi, testthat (≥ 3.0.0)
Encoding: UTF-8
RoxygenNote: 7.1.2
Imports: curl, cli, getPass, httr, keyring, rio, utils, XML
Config/testthat/edition: 3
NeedsCompilation: no
Packaged: 2022-01-16 06:15:05 UTC; taren
Author: Taren Sanders ORCID iD [aut, cre], Philip Parker ORCID iD [aut], Timothy Churches [aut]
Maintainer: Taren Sanders <taren.sanders@acu.edu.au>
Repository: CRAN
Date/Publication: 2022-01-16 06:32:41 UTC

cloudstoR: Simplifies Access to Cloudstor API

Description

Access Cloudstor via their WebDAV API. This package can read, write, and navigate Cloudstor from R.

Author(s)

Maintainer: Taren Sanders taren.sanders@acu.edu.au (ORCID)

Authors:

See Also

Useful links:


cloud_auth

Description

cloud_auth() gets the user's credentials and stores them securely in keyring.

Usage

cloud_auth(reset_keys = FALSE)

Arguments

reset_keys

Override existing keys.

Value

Nothing. Keys are stored in keyring.


cloud_auth_pwd

Description

Used to return a stored Cloudstor password, or request the user set one. Not a user-facing function.

Usage

cloud_auth_pwd()

Value

user password as string.


cloud_auth_user

Description

Used to return a stored Cloudstor username, or request the user set one. Not a user-facing function.

Usage

cloud_auth_user()

Value

user id as string.


cloud_browse

Description

cloud_browse() lets you navigate the folder tree interactively. This is useful for finding a file or folder path which can then be used in cloud_get() or cloud_put(). This function is only intended to be used interactively - you should not use this function programmatically.

When you call cloud_browse() you are given a list of files and folders (either at the top-level, or from the provided path). You provide the numeric number of the folder or file you wish to move to to continue. If you are not at the top level, you can select "../" to move up one folder. At any time you can select 0 to exit the interactive navigation.

If you select a folder, you are shown the files and folders within that folder. If you select a file, the full path for the file is shown (so that it can be passed to another function) and the interactive session is ended.

Usage

cloud_browse(path = "", user = cloud_auth_user(), password = cloud_auth_pwd())

Arguments

path

The initial path to start the search. If not provided, the function starts at the top-level folder.

user

Your Cloudstor username.

password

Your Cloudstor password.

Value

the last file path


cloud_get

Description

cloud_list() downloads a file from a Cloudstor folder. The file is opened and read into R using rio, or optionally the file path is returned.

Usage

cloud_get(
  path,
  dest = NULL,
  user = cloud_auth_user(),
  password = cloud_auth_pwd(),
  open_file = TRUE,
  ...
)

Arguments

path

The path to file or folder.

dest

The destination for saving the file.

user

Cloudstor user name

password

Cloudstor password

open_file

If TRUE, open the file using rio. Else, returns the file path

...

pass additional arguments to rio::import()

Value

The file object or folder path is returned, depending on open_file


cloud_list

Description

cloud_list() returns a list of the files located in a folder.

Usage

cloud_list(path = "", user = cloud_auth_user(), password = cloud_auth_pwd())

Arguments

path

The path to file or folder.

user

Cloudstor user name.

password

Cloudstor password.

Value

A list of files and folders.


cloud_meta

Description

cloud_meta() returns the metadata for a file or folder. This can be useful for checking if a file has been modified.

Usage

cloud_meta(path = "", user = cloud_auth_user(), password = cloud_auth_pwd())

Arguments

path

The path to file or folder.

user

Your Cloudstor username

password

Your Cloudstor password

Value

A data.frame of the file and folder metadata is returned.


cloud_put

Description

cloud_put() saves a file to Cloudstor. If the file already exists, it is replaced.

Usage

cloud_put(
  local_file,
  path = "",
  file_name = basename(local_file),
  user = cloud_auth_user(),
  password = cloud_auth_pwd()
)

Arguments

local_file

Where the file is located on your computer.

path

The destination on Cloudstor.

file_name

Optional. What you want to call the file on Cloudstor? If it is not provided, it is the same as the file name of the local file

user

Optional. Your Cloudstor username.

password

Optional. Your Cloudstor password.

Value

Nothing is returned. A success or error message is printed.


get_cloud_address

Description

Return the full cloud_address path. Not a user facing function.

Usage

get_cloud_address(path)

Arguments

path

path to file or folder

Value

encoded url as string


get_handle

Description

Return a handle for CURL to use. Not a user facing function

Usage

get_handle(user, password, reset = FALSE)

Arguments

user

Cloudstor username

password

Cloudstor password

reset

remove the existing authentication and handle

Value

curl handle object