API documentation for Python GpgMe bindings?

Bjoern Kahl mls at bjoern-kahl.de
Sun Oct 2 21:36:49 CEST 2016

 Dear All,

 I'd tried to play around with the (new) Python bindings announced just
 a few days ago, but I am a bit lost.  I am using Python-2.7 on MacOS
 "El Captain", with Python-2.7, gpg2, gpgme (1.6.0_2) and the bindings
 py27-pygpgme and pyme all installed using MacPorts.
 (Yes, that is not the newest gpgme-1.7.0 announced last week, the
  announcement last week just made me aware of the fact that there
  are Python binding at all.)

 I know the C-library documentation of GpgMe found here:

 Is there a similar documentation for the Python bindings "pyme" (or

 Google didn't return helpful results for "gpgme python api reference"
 or "pyme api reference" for me.

 Looking at the C-library documentation and the help() output in the
 Python interpreter for pyme and objects accessible from there, I fail
 to see a clear mapping on how to call various functions.

 For example, I can create a GpgMe context with "ctx = pyme.core.Context()"
 and find a key "key = ctx.get_key("the-key-id").

 But how do I - for example - change context attributes like the
 pinentry mode?

 The "pyme.core.Context" object doesn't seem to have a "set_attributes"
 or a "set_pinentry_mode" or anything related.  I found
 "pyme.pygpgme.gpgme_set_pinentry_mode()", which takes a context,
 but apparently a different flavour of a "context" than returned
 from "pyme.core.Context()".  Trying to pass the result from
 "pyme.core.Context()" to "pyme.pygpgme.gpgme_set_pinentry_mode()"
 gives a type error.  Also, the context from "pyme.core.Context()"
 doesn't seem to have a function to retrieve the underlying gpgme

 So, were can I find documentation of the Python bindings or guidelines
 how to apply the C-library documentation to the pyme bindings for
 Python (either 2.7 or 3.x)?

 Thanks & best regards


|     Bjoern Kahl   +++   Siegburg   +++    Germany     |
|     "mls at -my-domain-"   +++    www.bjoern-kahl.de     |
| Languages: German, English, Ancient Latin (a bit :-)) |

More information about the Gnupg-users mailing list