Skip to content

Getting Started

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)

macOS:

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

We currently support Python 3.9 to 3.13

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

The Python client is available in synchronous and asynchronous version:

Terminal window
pip3 install valkey-glide
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())
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())
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()
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()

For complete examples with error handling, please refer to:

Development instructions for local building & testing the package are in the developer section.