skillfed

python-gnupg

A wrapper for the Gnu Privacy Guard (GPG or GnuPG)

python-gnupg v0.5.6 17.6M downloads/30d#1,107 on PyPI143
Permissive license BSD Active released

What it is and what it does

python-gnupg is a wrapper around the GnuPG command-line tool that exposes its key management, encryption, decryption, signing, and verification capabilities to Python programs. It does not implement cryptography itself but delegates to an external GnuPG installation, making it a thin interface layer rather than a cryptographic library.

The package is intended for developers who need to integrate GPG operations into Python applications—managing keys, encrypting sensitive data, or verifying signatures. It supports Python 2.7 and Python 3.6 through 3.14, has no external Python dependencies, and installs as a pure-Python wheel. Maintenance is active, with the repository last updated in August 2026.

Use it for:

  • Encrypt sensitive configuration or credentials in Python applications without managing raw cryptographic primitives.
  • Automate GPG key operations (import, export, trust management) as part of deployment or key rotation workflows.
  • Verify GPG signatures on downloaded files or packages to confirm authenticity and integrity.
  • Sign documents or data programmatically to prove origin and non-repudiation in compliance workflows.
  • Build a Python-based key management interface that wraps GnuPG for team or organizational use.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides Python bindings to GnuPG for key management, encryption, decryption, signing, and signature verification operations.

Yes, if you need to integrate GnuPG operations into Python code and have GnuPG already installed on your system. The package is mature, actively maintained, has no Python dependencies, and carries no known vulnerabilities. It is well-suited for automation, key management, and signature workflows. Not suitable if you need a pure-Python cryptographic library without external tool dependencies.

Install

python-gnupg on PyPI

pip

pip install python-gnupg

uv

uv add python-gnupg

poetry

poetry add python-gnupg

Installing python-gnupg

Before you install

Low friction installation with no runtime dependencies. Active maintenance as of 2026-08-09 with recent releases; the package has been stable since its 2013 inception and supports a wide range of Python versions from 2.7 through 3.14.

License in practice

BSD license is permissive, allowing use in proprietary and open-source projects with minimal restrictions beyond attribution.

Quickstart

import gnupg

gpg = gnupg.GPG()
encrypted_data = gpg.encrypt('hello world', recipients=['user@example.com'])
print(encrypted_data.status)

Requires GnuPG (gpg or gpg2) to be installed and available on the system PATH; the Python module is a wrapper around the command-line tool.

Verify before relying

  • Whether the package works with GnuPG 2.x versions and what compatibility issues, if any, exist with modern GPG releases.
  • Performance characteristics when handling large keys or bulk encryption/decryption operations.

Package facts

License BSD (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 226 days since the last release
Last repo commit
First released
Downloads 17,637,239/month — #1,107 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: python_gnupg-0.5.6-py2.py3-none-any.whl

Keywords: GnuPG, cryptography, encryption, decryption, signing, verification

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python Modules

Tags

gnupg python wrappergpg encryption decryptionpython cryptography signinggnu privacy guard pythonpgp key management pythongpg signature verificationpython gnupg bindings
gpg-wrapperkey-managementsystem-integration

More Python Modules packages