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.
- Cross Platform - PyCreds is a cross platform solution for storing credentials, Windows, Linux and MacOS are fully supported.
- Security - Uses platform specific credential vault for storing credentials.
- API - Provides high level operations such as
get_password
,set_password
,delete_password
,find_password
andfind_credentials
. - Command Line Interface - Ships with a Cli based on click for Cli usage.
Install with pip:
$ pip install pycreds
# Or Install with cli
$ pip install pycreds[cli]
-
get_password(service, account)
Get the stored password for
service
andaccount
.service
- The string service name.account
- The string account name.Returns password as
string
if found else raisesValueError
. -
set_password(service, account, password)
Save the
password
forservice
andaccount
.service
- The string service name.account
- The string account name.password
- The string password.Returns
True
if successful else raisesValueError
. -
delete_password(service, account)
Delete the
password
forservice
andaccount
.service
- The string service name.account
- The string account name.Returns
True
if successful else raisesValueError
. -
find_password(service)
Finds
password
forservice
.service
- The string service name.Returns password as
string
if found else returnsNone
. -
find_credentials(service)
Finds credentials for
service
.service
- The string service name.Returns a list of credential dict in format
{"account": "foo", "password": "bar"}
.
Usage: pycreds [OPTIONS] COMMAND [ARGS]...
PyCreds Command Line Interface.
Options:
--help Show this message and exit.
Commands:
delete Delete Password.
get Get Password.
set Set Password.