Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public file access in R #25

Open
ChrisBollands opened this issue Aug 11, 2022 · 2 comments · May be fixed by #26
Open

Public file access in R #25

ChrisBollands opened this issue Aug 11, 2022 · 2 comments · May be fixed by #26
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@ChrisBollands
Copy link

ChrisBollands commented Aug 11, 2022

Hi there,
Sorry if this isn't the right place for this, I couldn't find other contact details.
I'm working on some documentation for my company assisting with researchers connecting to cloudstor via different methods.
The python library for cloudstor allows the user to access public files files sent to them with a link and a password. I would like to be able to do document this for R as well, is this possible within cloudstoR? If not could this be considered for a later version?

Thanks in advance, Chris.

@tarensanders
Copy link
Collaborator

Hi Chris,

Sure, that looks simple enough to implement. I should be able to get to that in the next week or so.

Cheers,
Taren

@tarensanders tarensanders added enhancement New feature or request good first issue Good for newcomers labels Aug 11, 2022
@tarensanders tarensanders self-assigned this Aug 18, 2022
@tarensanders tarensanders linked a pull request Aug 25, 2022 that will close this issue
@tarensanders
Copy link
Collaborator

@ChrisBollands I've opened a PR with these features. I still need to make some changes to the docs before I merge into master, and then it will probably go to CRAN a bit later in the year (I think I'll aim for October). In the meantime, I wonder if you'd be willing to test it? I don't really use public links all that often, and while all my tests pass I don't know how representative they are.

You can install with:

install.packages("devtools") # If you don't already have it
devtools::install_github("pdparker/cloudstoR#26")

Then load and use as usual.

The API is pretty simple:

  • Put the full URL (as provided by cloudstor) as the path argument, and optionally provided password if the link requires one for cloud_get. E.g., cloud_get(MYURL, password = MYPASSWORD)
  • The metadata that is returned for a single file does not have the extension, so it can't be automatically opened. If you provide a dest (e.g., dest = "mydata.csv"), it can be opened. Otherwise, you'll get a file path back for you to open as you like.
  • If the URL is to a folder, cloud_get() will download all the files at the top level and return a vector of file paths. I could not find a good way to get the folder details, so at the moment it only works for the top-level folder. if you provide dest it needs to be a folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants