gpgmepy

Python bindings for GPGME library enabling GPG operations

brewmacoslinux
Try with needOr install directly
Source

About

Python bindings for gpgme

Commands

gpgmepy

Examples

Import and list available GPG keys$ python3 -c "import gpgme; ctx = gpgme.Context(); print([key.uids[0].uid for key in ctx.keylist()])"
Encrypt a message to a recipient$ python3 -c "import gpgme; ctx = gpgme.Context(); key = list(ctx.keylist('recipient@example.com'))[0]; ctx.encrypt([key], open('plaintext.txt', 'r'), open('encrypted.gpg', 'wb'))"
Decrypt an encrypted file$ python3 -c "import gpgme; ctx = gpgme.Context(); ctx.decrypt(open('encrypted.gpg', 'rb'), open('decrypted.txt', 'wb'))"