module loghelper.pwd_helper

Short summary

module pyquickhelper.loghelper.pwd_helper

Helpers to store and retrieve password.

source on GitHub

Functions

function

truncated documentation

get_password

Restores a password. By default, uses keyring.

set_password

Stores a password. By default, uses keyring or keyrings.cryptfile.

Documentation

Helpers to store and retrieve password.

source on GitHub

pyquickhelper.loghelper.pwd_helper.get_password(system, username, lib='keyrings.cryptfile', env='KEYRING_CRYPTFILE_PASSWORD', ask=True)[source]

Restores a password. By default, uses keyring.

Parameters
  • system – system

  • username – username

  • lib – which lib to use to store the password

  • env – see below

  • ask – ask for password if missing

Returns

password

If lib == ‘keyrings.cryptfile’, the function used the environment variable env, if present, no password is asked.

source on GitHub

pyquickhelper.loghelper.pwd_helper.set_password(system, username, password, lib='keyrings.cryptfile', env='KEYRING_CRYPTFILE_PASSWORD', ask=True)[source]

Stores a password. By default, uses keyring or keyrings.cryptfile.

Parameters
  • system – system

  • username – username

  • password – password

  • lib – which lib to use to store the password

  • env – see below

  • ask – ask for password if missing

If lib == ‘keyrings.cryptfile’, the function used the environment variable env, if present, no password is asked.

source on GitHub