Adding and modifying user accounts¶
Before you can download data, you need to create a user account for the respective data provider and add your account information using the Pansat account manager. Here is an example for how you add an account, check your account info and delete an account.
[2]:
from pansat.download.accounts import add_identity, get_identity, delete_identity
Let’s say that you have created an account for the data provider Icare with
[12]:
username = 'Fritzi'
password = 'LattSomEnPlatt12345!'
Add your account info
[13]:
add_identity('Icare', username)
Please enter password for provider 'Icare' and username 'Fritzi':
········
Note that for Copernicus, you need to install a key and API client following the steps in https://cds.climate.copernicus.eu/api-how-to. This means that in addition to your username and password, you will have a url and key stored in $HOME/.cdsapirc. For this data provider simply use the url and key, instead of username and password:
[14]:
url = 'https://cds.climate.copernicus.eu/api/v2'
key = '{uid}:{api-key}'
add_identity('Copernicus', url)
Please enter the key for provider 'Copernicus' with url 'https://cds.climate.copernicus.eu/api/v2':
········
You can then check if your account info has been successfully stored in the encrypted identities.json
[15]:
get_identity('Icare')
[15]:
('Fritzi', "'LattSomEnPlatt12345!'")
[16]:
get_identity('Copernicus')
[16]:
('https://cds.climate.copernicus.eu/api/v2', "'{uid}:{api-key}'")
Note that your account info will be overwritten if you add an account with an existing username for a certain provider.
To delete your account info again, use:
[17]:
delete_identity('Copernicus')