lucadelu / pyModis

python library to work with MODIS data
http://www.pymodis.org/
Other
165 stars 85 forks source link

Enhancement: Use netrc standard file for authentication #77

Closed neteler closed 7 years ago

neteler commented 7 years ago

In order to standardize the possibilities to authenticate against the NASA server (for those who do not want to use the password on command line), here the suggestion to use the "$HOME/.netrc" file which is also supported by wget and other FTP related download tools:

https://docs.python.org/2/library/netrc.html

Workflow: if username/password are not specified on command line/GUI, check for the netrc file and use it if present.

lucadelu commented 7 years ago

Implemented in 3a66bea, @neteler could you test? (for me is working)

neteler commented 7 years ago

Maybe I messed up my installation but I get

` modis_download.py -e 2016-01-01 -f 2016-01-31 --product=MOD13C1.006 ndvi_MOD13C1.006/

Traceback (most recent call last): File "/usr/bin/modis_download.py", line 30, in from pymodis import optparse_required File "/usr/lib/python2.7/site-packages/pymodis/init.py", line 3, in from . import downmodis File "/usr/lib/python2.7/site-packages/pymodis/downmodis.py", line 30, in from pymodis import optparse_required ImportError: cannot import name optparse_required `

neteler commented 7 years ago

Luca, thanks for the updates in current master. Now netrc is working fine. Closing.