Store and access passwords safely with python’s keyring


old skeleton keysIntegrating a permanent keyring storage system into your python app is now drop dead simple.

From pypi.python.org, “The Python keyring lib provides a easy way to access the system keyring service from python. It can be used in any application that needs safe password storage.”

===Install it:===
====Run easy_install or pip:====

====Or install from source:====

====Use it:====

Store a password:

Now quit (ctrl-d) and start over. You should be able to access the password, like this:

===Python keyring lib:===
Python keyring library was created as a Google Summer of Code project. The keyring lib supports Windows win32crypto, Mac OS X’s SXKeychain, KDE’s KWallet, Gnome’s keyring, and encrypted or unencrypted password files. When your application wants to store or fetch data from the keyring, it will just work.

This is exactly what I needed — but if easy mode doesn’t suite you and you want/need to make your own backend or specify a specific keyring to use, you can do that by calling set_keyring() or specifying it in a config.


Posted on December 22nd, by admica in howto, python, simple.
Comments Off

Comments are closed.