ANN: python-gnupg v0.2.2 released
vinay_sajip at yahoo.co.uk
Tue Oct 6 19:33:31 CEST 2009
A new version of the Python module which wraps GnuPG has been
This is a minor bug-fix release. See the project website (
http://code.google.com/p/python-gnupg/ ) for more information.
The changes were to the name of the distribution archive (now prefixed
with "python-") and support was added for GnuPG v2.0.x (tested on
The current version passes all tests on Windows (Python 2.4, 2.5, 2.6,
3.1, Jython 2.5.1) and Ubuntu (Python 2.4, 2.5, 2.6, 3.0, Jython
What Does It Do?
The gnupg module allows Python programs to make use of the
functionality provided by the Gnu Privacy Guard (abbreviated GPG or
GnuPG). Using this module, Python programs can encrypt and decrypt
data, digitally sign documents and verify digital signatures, manage
(generate, list and delete) encryption keys, using proven Public Key
Infrastructure (PKI) encryption technology based on OpenPGP.
This module is expected to be used with Python versions >= 2.4, as it
makes use of the subprocess module which appeared in that version of
Python. This module is a newer version derived from earlier work by
Andrew Kuchling, Richard Jones and Steve Traugott.
A test suite using unittest is included with the source distribution.
>>> import gnupg
>>> gpg = gnupg.GPG(gnupghome='/path/to/keyring/directory')
'uids': ['', 'Gary Gross (A test user) <gary.gross at gamma.com>']},
'uids': ['', 'Danny Davis (A test user) <danny.davis at delta.com>']}]
>>> encrypted = gpg.encrypt("Hello, world!", ['0C5FEFA7A921FC4A'])
'-----BEGIN PGP MESSAGE-----\nVersion: GnuPG v1.4.9 (GNU/Linux)\n
-----END PGP MESSAGE-----\n'
>>> decrypted = gpg.decrypt(str(encrypted), passphrase='secret')
>>> signed = gpg.sign("Goodbye, world!", passphrase='secret')
>>> verified = verified = gpg.verify(str(signed))
>>> print "Verified" if verified else "Not verified"
For more information, visit http://code.google.com/p/python-gnupg/ -
as always, your feedback is most welcome (especially bug reports,
patches and suggestions for improvement). Enjoy!
Red Dove Consultants Ltd.
More information about the Python-list