keyring
Store and access your passwords safely.
Decision gist · record as of 2026-08-14
Yes. Keyring is a mature, actively maintained library (Production/Stable, 1504 GitHub stars, recent releases) with no known vulnerabilities, low install friction, and a permissive MIT license. It solves a real security problem—safe credential storage—by delegating to the OS rather than reinventing encryption. Install it if your application needs to store or retrieve passwords securely without managing encryption yourself. The only caveat is Linux users may need to install dbus-python as a system package for full KWallet support.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later.
- On Linux, KWallet backend requires dbus-python as a system package (pip installation may fail without it).
- macOS support requires Python 3.8.7+ with universal2 binary for macOS 11+.
License · maintenance · safety
MIT (permissive) — MIT license (permissive) imposes no significant restrictions on use or redistribution in proprietary or open-source projects.
last release 2025-11-16 (271 days) · last repo commit 2026-04-13 · 1,504 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 242,060,555 downloads/mo, #162 on PyPI
Alternatives
Verify before relying
import keyring
keyring.set_password("system", "username", "password")
password = keyring.get_password("system", "username")
print(password)- Whether all seven runtime dependencies install without compilation on typical Linux/Windows/macOS environments
- Performance characteristics when storing or retrieving many credentials in succession
- Behavior when the system keyring service is unavailable or misconfigured
What it is and what it does
Keyring is a Python library that abstracts away the complexity of storing and retrieving passwords securely by delegating to the operating system's native credential manager. Instead of managing plaintext files or custom encryption, your application calls keyring.set_password() and keyring.get_password() to store and retrieve credentials, and keyring automatically routes those calls to the appropriate backend: macOS Keychain, Windows Credential Locker, Freedesktop Secret Service (GNOME, KDE), or KWallet depending on the platform.
The library handles backend selection automatically but also allows programmatic configuration via set_keyring() or a config file. It includes a command-line utility for manual password management and supports third-party backends through entry points, so you can extend it with custom storage implementations (encrypted files, BitWarden, 1Password, etc.). The main dependencies are lightweight platform-specific libraries (pywin32-ctypes for Windows, SecretStorage and jeepney for Linux) plus jaraco utility modules.
Use it for
- Store API keys or database credentials in a Python application without embedding them in code or config files.
- Retrieve stored passwords programmatically in a CLI tool or daemon that needs to authenticate to external services.
- Manage multiple credentials across different services while delegating encryption to the OS keyring.
- Provide a command-line interface (via keyring command or python -m keyring) for manual password management.
- Extend keyring with a custom backend (e.g., encrypted file storage) by implementing the KeyringBackend interface.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Keyring is a mature, actively maintained library (Production/Stable, 1504 GitHub stars, recent releases) with no known vulnerabilities, low install friction, and a permissive MIT license. It solves a real security problem—safe credential storage—by delegating to the OS rather than reinventing encryption. Install it if your application needs to store or retrieve passwords securely without managing encryption yourself. The only caveat is Linux users may need to install dbus-python as a system package for full KWallet support.
Install
keyring on PyPI
Before you install
Low install friction with a pure Python wheel distribution. Seven runtime dependencies (pywin32-ctypes, SecretStorage, jeepney, importlib_metadata, jaraco.classes, jaraco.functools, jaraco.context) are all lightweight. Maintenance is active with a recent release (2025-11-16) and ongoing commits; the project has 1504 stars and is marked Production/Stable.
Requires Python 3.9 or later. On Linux, KWallet backend requires dbus-python as a system package (pip installation may fail without it). macOS support requires Python 3.8.7+ with universal2 binary for macOS 11+.
License in practice
MIT license (permissive) imposes no significant restrictions on use or redistribution in proprietary or open-source projects.
Quickstart
import keyring
keyring.set_password("system", "username", "password")
password = keyring.get_password("system", "username")
print(password)
Verify before relying
- Whether all seven runtime dependencies install without compilation on typical Linux/Windows/macOS environments
- Performance characteristics when storing or retrieving many credentials in succession
- Behavior when the system keyring service is unavailable or misconfigured
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 7 packagespywin32-ctypesSecretStoragejeepneyimportlib_metadatajaraco.classesjaraco.functoolsjaraco.context |
| Maintenance | Actively maintained 271 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 242,060,555 / month, #162 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: Only |
Evidence: keyring-25.7.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “system keyring access”
- keyringKeyring provides safe password and credential storage by interfacing…
- SecretStorageProvides Python bindings to the FreeDesktop.org Secret Service API…
- keyrings.altProvides alternate keyring backend implementations for the keyring…
Give your agent the search over MCP, or paste the wish link into any chat.
More Cryptography packages
Certifi provides Mozilla's curated collection of root SSL certificates for Python applications to validate TLS hosts and verify certificate trustworthiness.
cryptography provides cryptographic recipes and low-level primitives for symmetric encryption, message digests, key derivation, and other common cryptographic algorithms in Python.
Pure-Python RSA encryption, decryption, signing, and key generation following PKCS#1 v1.5, with command-line and library interfaces.
pyOpenSSL wraps OpenSSL's SSL/TLS functionality for Python, providing high-level connection objects and certificate handling through a Python-friendly interface around OpenSSL's cryptographic operations.
Provides Microsoft Entra ID token-based authentication for Azure SDK clients through a set of TokenCredential implementations that handle OAuth flows and managed identity support.
PyNaCl provides Python bindings to libsodium for digital signatures, secret-key and public-key encryption, hashing, message authentication, and password-based key derivation.
See also keyrings.alt · keyrings.cryptfile · SecretStorage · keyrings.google-artifactregistry-auth · artifacts-keyring · aws-encryption-sdk · onepassword · credstash · keyrings.codeartifact · azure-keyvault-secrets