Registry / auth-security / keyrings-alt

keyrings-alt

JSON →
library5.0.2pypypi✓ verified 24d ago

Keyrings-alt is a Python package that provides alternative backend implementations for the `keyring` library, enabling password storage solutions across various environments. It's currently at version 5.0.2 and maintains an active release cadence, often aligning with `keyring` library updates.

pip install keyrings-alt
INSTALL
IMPORT
SIG · KEYRINGS-ALT
K
keyrings-alt
auth-securitypythonv5.0.2
Install
1.9s avg
Import
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v5.0.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.9s · import 0.000s · 19MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

FileKeyring
from keyrings.alt.file import FileKeyring
from keyrings.alt import FileKeyring

This quickstart demonstrates how `keyrings-alt` integrates with the `keyring` library. Once `keyrings-alt` is installed, its alternative backends become available for `keyring` to discover and use automatically. The example shows setting and retrieving a password, and identifying the active keyring backend.

import keyring import os # keyrings-alt, once installed, provides additional backends # that the 'keyring' library automatically discovers and uses. service_name = "my-app-service" username = "test-user" password = os.environ.get('KEYRING_TEST_PASSWORD', 'super-secret-password-123') print(f"Using keyring for service '{service_name}', user '{username}'.") # Set a password. The 'keyring' library will try to use the best available backend, # which might be one provided by keyrings-alt if no stronger native keyring is present. keyring.set_password(service_name, username, password) print(f"Password set for service '{service_name}' user '{username}'.") # Retrieve the password retrieved_password = keyring.get_password(service_name, username) print(f"Retrieved password: {'*' * len(retrieved_password) if retrieved_password else 'None'}") if retrieved_password == password: print("Password retrieved successfully and matches original.") else: print("Password retrieval failed or did not match.") # You can inspect the currently active keyring backend current_keyring = keyring.get_keyring() print(f"\nCurrently active keyring backend: {current_keyring.__class__.__name__}")
Debug
Known issues
breaking`keyrings-alt` v4.0.0 and later require Python 3.8 or newer. Previous versions supported older Python environments.
fix
Upgrade to Python 3.8 or a later version, or use an older `keyrings-alt` version (e.g., `pip install 'keyrings-alt<4.0.0'`) if your project can't upgrade Python.
affects: >=4.0.0
breaking`keyrings-alt` v5.0.0 and later explicitly require `keyring` library version 24.0.0 or newer. Installing `keyrings-alt` might automatically upgrade `keyring`.
fix
Ensure your `keyring` installation is version 24.0.0 or higher. If you have dependency conflicts, resolve them by updating other packages or pinning `keyring` to a compatible version.
affects: >=5.0.0
gotchaUsers typically interact with `keyrings-alt` indirectly through the `keyring` library's API (e.g., `keyring.set_password`, `keyring.get_password`). Direct imports from `keyrings.alt` are generally for advanced scenarios like explicit backend instantiation.
fix
For most use cases, simply `import keyring` and use its functions. `keyrings-alt` is a dependency that provides the backend implementations for `keyring` to discover.
affects: all
gotchaDifferent backends provided by `keyrings-alt` (e.g., `FileKeyring`, `NullKeyring`) have varying security implications. Some backends, like `FileKeyring`, store credentials in plaintext or in less secure ways than system-native keyrings.
fix
Understand the security model of the specific keyring backend being used. Avoid using less secure backends (like `FileKeyring` for sensitive data) in production environments unless explicitly required and mitigated.
affects: all
Upgrade
Version history
5.0.2latest on PyPI · released Aug 14, 2024
Audit
Dependencies
keyringrequiredkeyrings-alt provides backend implementations for the `keyring` library; `keyring` is the primary interface users interact with.
Agent activity
29 hits · last 30 days
node
26
OpenAI (training)
1
Resources
keyrings-alt — pip install keyrings-alt · libregistry