python-gnupg
A wrapper for the Gnu Privacy Guard (GPG or GnuPG)
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-gnupguv
uv add python-gnupgpoetry
poetry add python-gnupgInstalling 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
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
ansible-signGenerates and validates checksums and GPG…
permissive · top 15,000 on PyPI
PGPy13PGPy13 is a Python library for OpenPGP…
permissive · top 15,000 on PyPI
PGPyPGPy implements OpenPGP (RFC 4880) in pure…
permissive · top 5,000 on PyPI
gnupgA Python wrapper around GnuPG that lets you…
copyleft · top 5,000 on PyPI
cryptoProvides command-line tools to encrypt and…
permissive · top 5,000 on PyPI
rsaPure-Python RSA encryption, decryption,…
permissive · top 1,000 on PyPI
pysequoiaPySequoia provides OpenPGP encryption,…
permissive · top 15,000 on PyPI
pywidevineImplements Widevine Content Decryption Module…
copyleft · top 15,000 on PyPI
xmlsecPython bindings for XML Security Library,…
permissive · top 5,000 on PyPI
scryptPython bindings for the scrypt key derivation…
permissive · top 15,000 on PyPI