valkey-glide 2.3.1


pip install valkey-glide

  Latest version

Released: Apr 01, 2026

Project Links

Meta
Author: Valkey GLIDE Maintainers
Requires Python: >=3.9

Classifiers

Topic
  • Software Development

License
  • OSI Approved :: Apache Software License

Intended Audience
  • Developers

Programming Language
  • Rust
  • Python :: Implementation :: CPython
  • Python :: Implementation :: PyPy

Welcome to Valkey GLIDE!

Valkey General Language Independent Driver for the Enterprise (GLIDE) is the official open-source Valkey client library, proudly part of the Valkey organization. Our mission is to make your experience with Valkey and Redis OSS seamless and enjoyable. Whether you're a seasoned developer or just starting out, Valkey GLIDE is here to support you every step of the way.

Why Choose Valkey GLIDE?

  • Community and Open Source: Join our vibrant community and contribute to the project. We are always here to respond, and the client is for the community.
  • Reliability: Built with best practices learned from over a decade of operating Redis OSS-compatible services.
  • Performance: Optimized for high performance and low latency.
  • High Availability: Designed to ensure your applications are always up and running.
  • Cross-Language Support: Implemented using a core driver framework written in Rust, with language-specific extensions to ensure consistency and reduce complexity.
  • Stability and Fault Tolerance: We brought our years of experience to create a bulletproof client.
  • Backed and Supported by AWS and GCP: Ensuring robust support and continuous improvement of the project.

Documentation

See GLIDE's Python documentation site.

Supported Engine Versions

Refer to the Supported Engine Versions table for details.

Getting Started - Python Wrapper

System Requirements

The release of Valkey GLIDE was tested on the following platforms:

Linux:

  • Ubuntu 20 (x86_64/amd64 and arm64/aarch64)
  • Amazon Linux 2 (AL2) and 2023 (AL2023) (x86_64)

Note: Currently Alpine Linux / MUSL is NOT supported.

macOS:

  • macOS 14.7 (Apple silicon/aarch_64)
  • macOS 13.7 (x86_64/amd64)

Python Supported Versions

Python Version
3.9
3.10
3.11
3.12
3.13

Valkey GLIDE transparently supports both the asyncio and trio concurrency frameworks.

Installation and Setup

โœ… Async Client

To install the async version:

pip install valkey-glide

Verify installation:

python3
>>> import glide

โœ… Sync Client

To install the sync version:

pip install valkey-glide-sync

Verify installation:

python3
>>> import glide_sync

Basic Examples

๐Ÿ” Async Client

โœ… Async Cluster Mode

import asyncio
from glide import GlideClusterClientConfiguration, NodeAddress, GlideClusterClient

async def test_cluster_client():
    addresses = [NodeAddress("address.example.com", 6379)]
    # It is recommended to set a timeout for your specific use case
    config = GlideClusterClientConfiguration(addresses, request_timeout=500)  # 500ms timeout
    client = await GlideClusterClient.create(config)
    set_result = await client.set("foo", "bar")
    print(f"Set response is {set_result}")
    get_result = await client.get("foo")
    print(f"Get response is {get_result}")

asyncio.run(test_cluster_client())

โœ… Async Standalone Mode

import asyncio
from glide import GlideClientConfiguration, NodeAddress, GlideClient

async def test_standalone_client():
    addresses = [
        NodeAddress("server_primary.example.com", 6379),
        NodeAddress("server_replica.example.com", 6379)
    ]
    # It is recommended to set a timeout for your specific use case
    config = GlideClientConfiguration(addresses, request_timeout=500)  # 500ms timeout
    client = await GlideClient.create(config)
    set_result = await client.set("foo", "bar")
    print(f"Set response is {set_result}")
    get_result = await client.get("foo")
    print(f"Get response is {get_result}")

asyncio.run(test_standalone_client())

๐Ÿ”‚ Sync Client

โœ… Sync Cluster Mode

from glide_sync import GlideClusterClientConfiguration, NodeAddress, GlideClusterClient

def test_cluster_client():
    addresses = [NodeAddress("address.example.com", 6379)]
    # It is recommended to set a timeout for your specific use case
    config = GlideClusterClientConfiguration(addresses, request_timeout=500)  # 500ms timeout
    client = GlideClusterClient.create(config)
    set_result = client.set("foo", "bar")
    print(f"Set response is {set_result}")
    get_result = client.get("foo")
    print(f"Get response is {get_result}")

test_cluster_client()

โœ… Sync Standalone Mode

from glide_sync import GlideClientConfiguration, NodeAddress, GlideClient

def test_standalone_client():
    addresses = [
        NodeAddress("server_primary.example.com", 6379),
        NodeAddress("server_replica.example.com", 6379)
    ]
    # It is recommended to set a timeout for your specific use case
    config = GlideClientConfiguration(addresses, request_timeout=500)  # 500ms timeout
    client = GlideClient.create(config)
    set_result = client.set("foo", "bar")
    print(f"Set response is {set_result}")
    get_result = client.get("foo")
    print(f"Get response is {get_result}")

test_standalone_client()

PubSub Configuration

Valkey GLIDE supports dynamic PubSub with automatic subscription reconciliation. Configure the reconciliation interval to ensure subscriptions remain synchronized:

# Async client
from glide import GlideClientConfiguration, NodeAddress, GlideClient, AdvancedGlideClientConfiguration

config = GlideClientConfiguration(
    addresses=[NodeAddress("localhost", 6379)],
    advanced_config=AdvancedGlideClientConfiguration(
        pubsub_reconciliation_interval=5000  # Reconcile every 5 seconds (in milliseconds)
    )
)
client = await GlideClient.create(config)

# Sync client
from glide_sync import GlideClientConfiguration, NodeAddress, GlideClient, AdvancedGlideClientConfiguration

config = GlideClientConfiguration(
    addresses=[NodeAddress("localhost", 6379)],
    advanced_config=AdvancedGlideClientConfiguration(
        pubsub_reconciliation_interval=5000  # Reconcile every 5 seconds (in milliseconds)
    )
)
client = GlideClient.create(config)

Pre-configured Subscriptions

You can configure subscriptions at client creation time. The client will automatically establish these subscriptions during connection:

# Async client with pre-configured subscriptions
from glide import (
    GlideClientConfiguration,
    NodeAddress,
    GlideClient,
)

def message_callback(msg, context):
    print(f"Received message on {msg.channel}: {msg.message}")

config = GlideClientConfiguration(
    addresses=[NodeAddress("localhost", 6379)],
    pubsub_subscriptions=GlideClientConfiguration.PubSubSubscriptions(
        channels_and_patterns={
            GlideClientConfiguration.PubSubChannelModes.Exact: {"news", "updates"},
            GlideClientConfiguration.PubSubChannelModes.Pattern: {"events.*", "logs.*"},
        },
        callback=message_callback,
        context=None  # Optional context passed to callback
    )
)
client = await GlideClient.create(config)

# Cluster client with sharded pubsub
from glide import GlideClusterClientConfiguration, GlideClusterClient

config = GlideClusterClientConfiguration(
    addresses=[NodeAddress("localhost", 6379)],
    pubsub_subscriptions=GlideClusterClientConfiguration.PubSubSubscriptions(
        channels_and_patterns={
            GlideClusterClientConfiguration.PubSubChannelModes.Exact: {"channel1"},
            GlideClusterClientConfiguration.PubSubChannelModes.Pattern: {"pattern*"},
            GlideClusterClientConfiguration.PubSubChannelModes.Sharded: {"shard_channel"},
        },
        callback=message_callback,
        context=None
    )
)
cluster_client = await GlideClusterClient.create(config)

Dynamic Subscription Management

Subscribe and unsubscribe at runtime:

# Subscribe to channels
await client.subscribe({"channel1", "channel2"}, timeout_ms=5000)

# Subscribe to patterns
await client.psubscribe({"news.*", "events.*"}, timeout_ms=5000)

# Unsubscribe from specific channels
await client.unsubscribe({"channel1"}, timeout_ms=5000)

# Unsubscribe from all channels
from glide.async_commands.core import ALL_CHANNELS
await client.unsubscribe(ALL_CHANNELS, timeout_ms=5000)

# Unsubscribe from all patterns
from glide.async_commands.core import ALL_PATTERNS
await client.punsubscribe(ALL_PATTERNS, timeout_ms=5000)

# Cluster: sharded pubsub
await cluster_client.ssubscribe({"shard_channel"}, timeout_ms=5000)
await cluster_client.sunsubscribe({"shard_channel"}, timeout_ms=5000)

# Check subscription state
state = await client.get_subscriptions()
print(f"Desired: {state.desired_subscriptions}")
print(f"Actual: {state.actual_subscriptions}")

Client Statistics

Monitor client performance and subscription health using get_statistics():

stats = await client.get_statistics()  # Async
# or
stats = client.get_statistics()  # Sync

# Available metrics:
# - total_connections: Number of active connections
# - total_clients: Number of client instances
# - total_values_compressed: Count of compressed values
# - total_values_decompressed: Count of decompressed values
# - total_original_bytes: Original data size before compression
# - total_bytes_compressed: Compressed data size
# - total_bytes_decompressed: Decompressed data size
# - compression_skipped_count: Times compression was skipped
# - subscription_out_of_sync_count: Failed reconciliation attempts
# - subscription_last_sync_timestamp: Last successful sync (milliseconds since epoch)

OpenTelemetry Configuration

Valkey GLIDE supports OpenTelemetry for distributed tracing and metrics collection. This allows you to monitor command execution, measure latency, and track performance across your application.

Basic OpenTelemetry Setup

Both async and sync clients support OpenTelemetry configuration:

# Async client
from glide import OpenTelemetry, OpenTelemetryConfig, OpenTelemetryTracesConfig, OpenTelemetryMetricsConfig

# Sync client
from glide_sync import OpenTelemetry, OpenTelemetryConfig, OpenTelemetryTracesConfig, OpenTelemetryMetricsConfig

# Initialize OpenTelemetry (once per process)
OpenTelemetry.init(OpenTelemetryConfig(
    traces=OpenTelemetryTracesConfig(
        endpoint="http://localhost:4318/v1/traces",  # OTLP HTTP endpoint
        sample_percentage=1  # Sample 1% of requests (default)
    ),
    metrics=OpenTelemetryMetricsConfig(
        endpoint="http://localhost:4318/v1/metrics"
    ),
    flush_interval_ms=5000  # Flush every 5 seconds (default)
))

Supported Endpoints

  • HTTP/HTTPS: http://localhost:4318/v1/traces or https://...
  • gRPC: grpc://localhost:4317
  • File: file:///tmp/traces.json (for local testing)

Runtime Configuration

You can adjust the sampling percentage at runtime:

# Change sampling to 10%
OpenTelemetry.set_sample_percentage(10)

# Check current sampling rate
current_rate = OpenTelemetry.get_sample_percentage()

Note: OpenTelemetry can only be initialized once per process. To change configuration, restart your application.


For complete examples with error handling, please refer to:

Building & Testing

Development instructions for local building & testing the package are in the DEVELOPER.md file.

Community and Feedback

We encourage you to join our community to support, share feedback, and ask questions. You can approach us for anything on our Valkey Slack: Join Valkey Slack.

2.3.1 Apr 01, 2026
2.3.0 Mar 19, 2026
2.3.0rc7 Mar 16, 2026
2.3.0rc6 Mar 10, 2026
2.3.0rc5 Mar 05, 2026
2.2.9 Mar 27, 2026
2.2.7 Feb 09, 2026
2.2.6 Jan 19, 2026
2.2.5 Jan 09, 2026
2.2.5rc1 Jan 09, 2026
2.2.3 Dec 17, 2025
2.2.3rc1 Dec 17, 2025
2.2.2 Dec 11, 2025
2.2.2rc2 Dec 10, 2025
2.2.2rc1 Dec 10, 2025
2.2.1 Dec 03, 2025
2.2.1rc3 Dec 03, 2025
2.2.1rc1 Dec 02, 2025
2.2.0 Nov 26, 2025
2.2.0rc2 Nov 19, 2025
2.2.0rc1 Nov 13, 2025
2.1.1 Oct 08, 2025
2.1.1rc3 Oct 07, 2025
2.1.1rc2 Oct 02, 2025
2.1.0 Sep 17, 2025
2.1.0rc9 Sep 16, 2025
2.1.0rc8 Sep 11, 2025
2.1.0rc7 Sep 10, 2025
2.1.0rc6 Sep 10, 2025
2.1.0rc5 Sep 10, 2025
2.1.0rc4 Sep 09, 2025
2.1.0rc3 Sep 08, 2025
2.1.0rc2 Sep 07, 2025
2.1.0rc1 Sep 07, 2025
2.0.1 Jun 20, 2025
2.0.0 Jun 18, 2025
2.0.0rc7 May 20, 2025
2.0.0rc6 May 15, 2025
2.0.0rc5 May 13, 2025
2.0.0rc2 May 11, 2025
1.3.5 May 12, 2025
1.3.5rc5 May 12, 2025
1.3.5rc4 May 12, 2025
1.3.5rc3 May 12, 2025
1.3.5rc2 May 12, 2025
1.3.4 May 06, 2025
1.3.4rc9 May 12, 2025
1.3.4rc8 May 11, 2025
1.3.4rc6 May 06, 2025
1.3.4rc5 May 06, 2025
1.3.4rc1 May 06, 2025
1.3.3 May 06, 2025
1.3.3rc0 May 06, 2025
1.3.2 Apr 06, 2025
1.3.1 Mar 04, 2025
1.3.1rc1 Mar 04, 2025
1.3.0 Feb 15, 2025
1.3.0rc1 Feb 13, 2025
1.2.1 Dec 26, 2024
1.2.1rc5 Dec 26, 2024
1.2.1rc3 Dec 26, 2024
1.2.1rc2 Dec 26, 2024
1.2.1rc1 Dec 26, 2024
1.2.1rc0 Dec 26, 2024
1.2.0 Nov 27, 2024
1.2.0rc18 Nov 27, 2024
1.2.0rc17 Nov 26, 2024
1.2.0rc14 Nov 26, 2024
1.2.0rc13 Nov 26, 2024
1.2.0rc12 Nov 26, 2024
1.2.0rc10 Nov 26, 2024
1.2.0rc9 Nov 26, 2024
1.2.0rc7 Nov 26, 2024
1.2.0rc6 Nov 26, 2024
1.2.0rc4 Nov 25, 2024
1.2.0rc3 Nov 24, 2024
1.2.0rc2 Nov 12, 2024
1.2.0rc1 Nov 11, 2024
1.1.0 Sep 23, 2024
1.1.0rc9 Sep 18, 2024
1.1.0rc8 Sep 18, 2024
1.1.0rc7 Sep 18, 2024
1.1.0rc2 Sep 18, 2024
1.1.0rc1 Sep 17, 2024
1.0.1 Jul 11, 2024
1.0.1rc1 Jul 11, 2024
1.0.0 Jul 09, 2024
1.0.0rc1 Jul 08, 2024

Wheel compatibility matrix

Platform CPython 3.9 CPython 3.10 CPython 3.11 CPython 3.12 CPython 3.13 CPython 3.14 PyPy 3.9 (pp73) PyPy 3.10 (pp73) PyPy 3.11 (pp73)
macosx_10_7_x86_64
macosx_11_0_arm64
manylinux2014_aarch64
manylinux2014_x86_64
manylinux_2_17_aarch64
manylinux_2_17_x86_64

Files in release

valkey_glide-2.3.1-cp310-cp310-macosx_10_7_x86_64.whl (7.0MiB)
valkey_glide-2.3.1-cp310-cp310-macosx_11_0_arm64.whl (6.5MiB)
valkey_glide-2.3.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (6.8MiB)
valkey_glide-2.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.2MiB)
valkey_glide-2.3.1-cp311-cp311-macosx_10_7_x86_64.whl (7.0MiB)
valkey_glide-2.3.1-cp311-cp311-macosx_11_0_arm64.whl (6.5MiB)
valkey_glide-2.3.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (6.8MiB)
valkey_glide-2.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.2MiB)
valkey_glide-2.3.1-cp312-cp312-macosx_10_7_x86_64.whl (7.0MiB)
valkey_glide-2.3.1-cp312-cp312-macosx_11_0_arm64.whl (6.5MiB)
valkey_glide-2.3.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (6.8MiB)
valkey_glide-2.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.2MiB)
valkey_glide-2.3.1-cp313-cp313-macosx_10_7_x86_64.whl (7.0MiB)
valkey_glide-2.3.1-cp313-cp313-macosx_11_0_arm64.whl (6.5MiB)
valkey_glide-2.3.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (6.8MiB)
valkey_glide-2.3.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.2MiB)
valkey_glide-2.3.1-cp314-cp314-macosx_10_7_x86_64.whl (7.0MiB)
valkey_glide-2.3.1-cp314-cp314-macosx_11_0_arm64.whl (6.5MiB)
valkey_glide-2.3.1-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (6.8MiB)
valkey_glide-2.3.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.2MiB)
valkey_glide-2.3.1-cp39-cp39-macosx_10_7_x86_64.whl (7.0MiB)
valkey_glide-2.3.1-cp39-cp39-macosx_11_0_arm64.whl (6.5MiB)
valkey_glide-2.3.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (6.8MiB)
valkey_glide-2.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.2MiB)
valkey_glide-2.3.1-pp310-pypy310_pp73-macosx_10_7_x86_64.whl (7.0MiB)
valkey_glide-2.3.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl (6.5MiB)
valkey_glide-2.3.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (6.8MiB)
valkey_glide-2.3.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.2MiB)
valkey_glide-2.3.1-pp311-pypy311_pp73-macosx_10_7_x86_64.whl (7.0MiB)
valkey_glide-2.3.1-pp311-pypy311_pp73-macosx_11_0_arm64.whl (6.5MiB)
valkey_glide-2.3.1-pp311-pypy311_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (6.8MiB)
valkey_glide-2.3.1-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.2MiB)
valkey_glide-2.3.1-pp39-pypy39_pp73-macosx_10_7_x86_64.whl (7.0MiB)
valkey_glide-2.3.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl (6.5MiB)
valkey_glide-2.3.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (6.8MiB)
valkey_glide-2.3.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.2MiB)
valkey_glide-2.3.1.tar.gz (813.2KiB)
Extras: None
Dependencies:
anyio (>=4.9.0)
protobuf (>=6.20)
sniffio
typing-extensions (>=4.8.0)