cython wrapping gpgme WAS: Thoughts on GnuPG and automation

Daniele Nicolodi daniele at grinta.net
Mon Mar 9 22:40:33 CET 2015


On 09/03/15 20:27, Hans-Christoph Steiner wrote:
>> I have no idea about the Java tooling for interfacing to external
>> libraries, but (after seeing so many complaints on the mailing list)
>> I've recently started to work on Python bindings to GPGME using Cython,
>> and so far it has been an extremely smooth process and the resulting
>> Python API feels quite pythonic (I haven't started with the asynchronous
>> calls yet, those will probably be harder to map in a pythonic way).
>>
>> The fact that writing the bindings is quite easy, is due indeed to the
>> fact that GPGME is a fine API for C (and to Cython to a large extent).
> 
> There are other C-Python wrappers of GPGME, like pyme.  I hope you're aware of
> those, and have studied them.  One thing that GnuPG suffers from is many
> people starting their own wrappers, but few people finishing them or
> contributing to existing ones.  That is not a sustainable situation.


Hello Hans-Christoph,

yes, I'm aware that there are other wrappers for GPGME. I cannot say
that I studied them in detail, but I can give you my reasons why I
started to work on a new one.   I'm doing this in my (quite scarce)
spare time, so the first requirements is that the development should be fun.

> http://pyme.sourceforge.net/

I knew this one. It is based on SWIG, and my experience with SWIG is
such that I want to stay as far as I can from that horrible mess.

> https://launchpad.net/pygpgme

I didn't know this one. It is interesting. However, it is written
directly in C using the CPython extension API and this makes development
quite tedious. There is probably something to learn from this project.

> http://www.red-dove.com/python_gnupg/
> https://bitbucket.org/vinay.sajip/python-gnupg
> https://github.com/isislovecruft/python-gnupg

Those, as far as I know, work using the gpg command line, not the GPGME
library and are all based on the same code. Unfortunately the gpg
command line does not make some operations easy to script, therefore
those are quite limited.

Cheers,
Daniele




More information about the Gnupg-users mailing list