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

Add "ask" option to EarthdataLogin to enable non-interactive login and control credentials file path #75

Open
nuest opened this issue Sep 19, 2019 · 3 comments

Comments

@nuest
Copy link

nuest commented Sep 19, 2019

I would like to run a script for downloading data. I have stored my credentials in environment variable and they are used, but MODIS always asks if I want to change them:

> MODIS::EarthdataLogin(usr = Sys.getenv("EARTHDATA_USER"), pwd = Sys.getenv("EARTHDATA_PASS"))
Earthdata credentials seem to be present, do you want to change them? (y/n) 

Would you welcome a PR adding an option ask with default TRUE to the function EarthdataLogin(..) login to disable the question?

In addition:

  • An option with current default credentialsPath = path.expand(~/.nrc) would give users more control, in cases where the user home is not a suitable storage location.
  • In the same style als MODISoptions(..), a save = TRUE parameter could even be added to disable creating the .netrc file.

Happy to prepare a PR if you're available for review (and maybe even a minor version release?)

@nuest
Copy link
Author

nuest commented Sep 19, 2019

My current workaround is to do a file.remove(path.expand("~/.netrc")) before EarthdataLogin(..).

@fdetsch
Copy link
Owner

fdetsch commented Nov 4, 2019

Hey @nuest,

I'd be happy to receive and review a PR from you, the suggested changes seem perfectly reasonable. EarthdataLogin() emerged as kind of a hotfix when login-restricted data download was first introduced, which I guess leaves quite a lot of space for improvement.

@nuest
Copy link
Author

nuest commented Sep 24, 2020

@fdetsch Sorry for the long silence - I'm just picking up this workflow again. AFAICT this is still the case, so I can give it another go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants