Use the keyring python module with gnome-keyring
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 196
- PR merge metrics
- No merged PRs in 30d
Description
Not exactly a bug, but a lack of documentation. Sorry if it is not the right use of keyring.
In a shell script I can get a needed password from gnome-keyring to a variable or feed it via pipe to some program:
```
passwd=$(secret-tool lookup user myname domain somehost.com)
```
If I got it right, keyring can be used for the same purpose in a python script. I could not find any minimal working example example to do that in python with keyring module. There probably must be a better way than using `os.popen(cmd).read()` with the above shell command...
The example from the README file
```
$ python
>>> import keyring
>>> keyring.get_keyring()
>>> keyring.set_password("system", "username", "password")
>>> keyring.get_password("system", "username")
```
launces "KDE Wallet Service" configuration which is not relevant for me, since I use gnome-keyring...
Thank you!
**Environment**
- OS: Ubuntu 22.04
```
$ dpkg -l |grep python3-keyring
ii python3-keyring 23.5.0-1 all store and access your passwords safely
$ keyring --list-backends
keyring.backends.kwallet.DBusKeyring (priority: 4.9)
keyring.backends.fail.Keyring (priority: 0)
keyring.backends.chainer.ChainerBackend (priority: 10)
keyring.backends.libsecret.Keyring (priority: 4.8)
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the existing Python examples in README and the reported `secret-tool` usage for gnome-keyring. Verify how the keyring module selects the libsecret backend in the listed Ubuntu environment, then document a minimal Python example and the relevant backend configuration so the README clearly covers gnome-keyring.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100