Package 'cloudstoR'

Title: Simplifies Access to Cloudstor API
Description: Access Cloudstor via their WebDAV API. This package can read, write, and navigate Cloudstor from R.
Authors: Taren Sanders [aut, cre] , Philip Parker [aut] , Timothy Churches [aut]
Maintainer: Taren Sanders <[email protected]>
License: GPL (>= 3)
Version: 0.2.0
Built: 2024-10-24 05:14:48 UTC
Source: https://github.com/pdparker/cloudstor

Help Index


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