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-syncVerified import paths — ran on the pinned version, not inferred.
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.
Update import statements from `from glide import ...` to `from glide_sync import ...` for synchronous client components.
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.
Append `.get()` to all command calls to synchronously retrieve their results, e.g., `value = client.get('key').get()`.Instantiate `GlideClient` for standalone servers and `GlideClusterClient` for cluster environments, ensuring the configuration matches the deployment type.
Design your application to initialize OpenTelemetry tracing and metrics once at startup. For configuration changes, a process restart is required.
Install the package using `pip install valkey-glide-sync` and ensure the import statement is `from valkey_glide_sync.client import ValkeyClient`.
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.
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)`.
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)`.
No dependency data recorded yet.