module automation.credentials_helper#

Short summary#

module ensae_projects.automation.credentials_helper

Helpers around credentials.

source on GitHub

Functions#

function

truncated documentation

get_password

Retrieves a password with keyring.

set_password

Stores a password with keyring.

Documentation#

Helpers around credentials.

source on GitHub

ensae_projects.automation.credentials_helper.get_password(k1, k2)#

Retrieves a password with keyring.

Parameters:
  • k1 – first key

  • k2 – second key

Returns:

value

source on GitHub

ensae_projects.automation.credentials_helper.set_password(k1, k2, value)#

Stores a password with keyring.

Parameters:
  • k1 – first key

  • k2 – second key

  • value – value

How to avoid entering the credentials everytime?

Using clear credentials in a program file or in a notebook is dangerous. You should do that. However, it is annoying to type his password every time it is required. The solution is to store it with keyring. You need to execute only once:

from pyquickhelper.loghelper import set_password
set_password("k1", "k2", "value")

And you can retrieve the password anytime not necessarily in the same program:

from pyquickhelper.loghelper import set_password
set_password("k1", "k2", "value")

source on GitHub