Registry / database / valkey-glide-sync

valkey-glide-sync

JSON →
library2.5.1pypypi✓ verified 27d ago

Valkey GLIDE Sync is an official open-source Valkey client library for Python, designed to interact with Valkey and Redis OSS in a synchronous manner. It supports both standalone and cluster deployments, offering features like automatic topology discovery, read-from-replica options, and OpenTelemetry integration. The library is part of the Valkey organization and aims for high performance and reliability, currently at version 2.3.1.

pip install valkey-glide-sync
INSTALL
IMPORT
SIG · VALKEY-GLIDE-SYNC
V
valkey-glide-sync
databasepythonv2.5.1
Install
2.9s avg
Import
500ms
Disk
38MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v2.5.1 · 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.10–3.95 runs
build_error
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 2.9s · import 0.500s · 39MB
38MB installed
● package 38MB
Code
Verified usage

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

GlideClient
✓ from glide_sync import GlideClient
✗ from glide import GlideClient
The `glide` package is for the asynchronous client. The synchronous client classes are in `glide_sync`.
GlideClusterClient
✓ from glide_sync import GlideClusterClient
✗ from glide import GlideClusterClient
The `glide` package is for the asynchronous client. The synchronous client classes are in `glide_sync`.
GlideClientConfiguration
✓ from glide_sync import GlideClientConfiguration
NodeAddress
✓ from glide_sync import NodeAddress

This quickstart demonstrates how to connect to a standalone Valkey or Redis OSS instance using the synchronous Glide client, perform a simple PING, SET, and GET operation, and then close the client. It uses environment variables for host and port, falling back to localhost:6379 for local testing. Remember to use `.get()` to retrieve results from the synchronous client's future-like return values.

import os from glide_sync import GlideClient, GlideClientConfiguration, NodeAddress # Configure connection details (e.g., from environment variables) HOST = os.environ.get('GLIDE_HOST', 'localhost') PORT = int(os.environ.get('GLIDE_PORT', '6379')) PASSWORD = os.environ.get('GLIDE_PASSWORD', '') # Optional # For Standalone client config = GlideClientConfiguration( addresses=[NodeAddress(host=HOST, port=PORT)], password=PASSWORD if PASSWORD else None # Set password only if provided ) # Create and connect the client (sync method) try: client = GlideClient.create(config).get() response = client.ping().get() print(f"Ping response: {response}") client.set('mykey', 'myvalue').get() value = client.get('mykey').get() print(f"Retrieved value for 'mykey': {value}") except Exception as e: print(f"An error occurred: {e}") finally: if 'client' in locals() and client: client.close()
Debug
Known issues
breakingIn version 2.1, the Python package structure underwent a significant change. Previously, core components might have been accessible directly under `glide`. Now, synchronous client classes are specifically under `glide_sync`, and shared components are under `glide_shared`. This change can break existing imports if not updated.
fix
Update import statements from `from glide import ...` to `from glide_sync import ...` for synchronous client components.
affects: >=2.1.0
gotchaValkey GLIDE offers both synchronous (`valkey-glide-sync`) and asynchronous (`valkey-glide`) Python clients. Ensure you install and import from the correct package (`glide_sync` for sync, `glide` for async) based on your application's concurrency model. Mixing them or using the wrong package can lead to unexpected behavior or `AttributeError`s.
fix
Always use `pip install valkey-glide-sync` and `from glide_sync import ...` for synchronous operations, or `pip install valkey-glide` and `from glide import ...` for asynchronous operations.
affects: All versions
gotchaWhen executing commands with the synchronous client, the methods return a future-like object. You must explicitly call `.get()` on the result of a command (e.g., `client.ping().get()`) to retrieve the actual value or wait for completion. Failing to do so will result in an unawaited future object.
fix
Append `.get()` to all command calls to synchronously retrieve their results, e.g., `value = client.get('key').get()`.
affects: All versions
gotchaFor cluster deployments, you must use `GlideClusterClient` and `GlideClusterClientConfiguration`. For standalone deployments, use `GlideClient` and `GlideClientConfiguration`. Using the wrong client type for your Redis/Valkey setup will result in connection or command execution errors.
fix
Instantiate `GlideClient` for standalone servers and `GlideClusterClient` for cluster environments, ensuring the configuration matches the deployment type.
affects: All versions
gotchaOpenTelemetry configuration can only be initialized once per process. If you need to change OpenTelemetry settings, your application must be restarted to apply the new configuration.
fix
Design your application to initialize OpenTelemetry tracing and metrics once at startup. For configuration changes, a process restart is required.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'valkey_glide_sync'
The `valkey-glide-sync` package is either not installed in the current Python environment or there is a typo in the import statement.
fix
Install the package using `pip install valkey-glide-sync` and ensure the import statement is `from valkey_glide_sync.client import ValkeyClient`.
ConnectionRefusedError: [Errno 111] Connection refused
The Valkey or Redis server the client is attempting to connect to is not running, is configured on a different host/port, or a network firewall is preventing the connection.
fix
Verify that the Valkey/Redis server is actively running and accessible from the client's machine at the specified host and port. Check server logs and network configurations.
TypeError: ValkeyClient() missing 1 required positional argument: 'config'
The `ValkeyClient` constructor requires an instance of `GlideClientConfiguration` to define connection parameters and client behavior.
fix
Instantiate `ValkeyClient` by passing a `GlideClientConfiguration` object, for example: `from valkey_glide_sync.client import ValkeyClient, GlideClientConfiguration; config = GlideClientConfiguration(host='localhost', port=6379); client = ValkeyClient(config)`.
glide.exceptions.GlideClientException: Cluster mode is enabled, but single host was provided.
The client was initialized with `cluster_mode=True` or connected to a cluster port, but the configuration provided only a single host instead of a list of cluster seed nodes.
fix
When connecting to a Valkey/Redis cluster, provide a list of multiple host-port tuples (seed nodes) to the `GlideClientConfiguration`, e.g., `config = GlideClientConfiguration(host=['host1:port1', 'host2:port2'], cluster_mode=True)`.
Upgrade
Version history
2.5.1latest on PyPI · released Aug 10, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
35 hits · last 30 days
node
28
Bingbot
1
OpenAI (training)
1
Resources