keychain — Secure Password Storage

The keychain module provides simple access to secure password storage.

Please note that the keychain is not shared between apps, so you (fortunately) cannot use this to access passwords that are stored in Safari’s keychain, for example.

keychain.get_password(service, account)

Get the password for the given service/account that was previously stored in the keychain.

keychain.set_password(service, account, password)

Save a password for the given service/account in the keychain.

keychain.delete_password(service, account)

Delete the password for the given service/account from the keychain.

keychain.reset_keychain()

Delete all data from the keychain.