Windows Credential Manager backend for keyring for WSL.
This package allows Python applications running in WSL (Windows Subsystem for Linux) to store secrets in the Windows Credential Manager.
pip install keyring-wincred
or
git clone https://github.com/ilpianista/keyring_wincred.git
cd keyring_wincred
pip install .Once installed, keyring should automatically detect and use this backend when running under WSL. To force it configure ~/.config/python_keyring/keyringrc.cfg like so:
[backend]
default-keyring = keyring_wincred.WinCredKeyring
Instead, in Python:
import keyring
# Store a password
keyring.set_password("myservice", "myuser", "secret123")
# Retrieve a password
password = keyring.get_password("myservice", "myuser")
# Delete a password
keyring.delete_password("myservice", "myuser")You can also use the keyring CLI:
keyring set myservice myuser
keyring get myservice myuser
keyring del myservice myuserThis backend uses PowerShell with inline C# code to call the Windows Credential Manager API (advapi32.dll). No external PowerShell modules are required.
Credentials are stored with target names in the format service:username.
- WSL (Windows Subsystem for Linux)
- Python 3.8+
keyringpackage
Donations via Liberapay or Bitcoin (1Ph3hFEoQaD4PK6MhL3kBNNh9FZFBfisEH) are always welcomed, thank you!
MIT