PyCreds is a Python Library written in C++ to keep credentials safe by storing in platform keystores. On MacOS the passwords are managed by the Keychain, on Linux they are managed by the Secret Service API/libsecret, and on Windows they are managed by Credential Vault.
-
get_password(service, account)
Get the stored password for service
and account
.
service
- The string service name.
account
- The string account name.
Returns password as string
if found else raises ValueError
.
-
set_password(service, account, password)
Save the password
for service
and account
.
service
- The string service name.
account
- The string account name.
password
- The string password.
Returns True
if successful else raises ValueError
.
-
delete_password(service, account)
Delete the password
for service
and account
.
service
- The string service name.
account
- The string account name.
Returns True
if successful else raises ValueError
.
-
find_password(service)
Finds password
for service
.
service
- The string service name.
Returns password as string
if found else returns None
.
-
find_credentials(service)
Finds credentials for service
.
service
- The string service name.
Returns a list of credential dict in format {"account": "foo", "password": "bar"}
.