valkey-py - Python Client for Valkey#

Getting Started#

valkey-py requires a running Valkey server, and Python 3.7+. See the Valkey quickstart for Valkey installation instructions.

valkey-py can be installed using pip via pip install valkey.

Quickly connecting to valkey#

There are two quick ways to connect to Valkey.

Assuming you run Valkey on localhost:6379 (the default)

import valkey
r = valkey.Valkey()
r.ping()

Running valkey on foo.bar.com, port 12345

import valkey
r = valkey.Valkey(host='foo.bar.com', port=12345)
r.ping()

Another example with foo.bar.com, port 12345

import valkey
r = valkey.from_url('valkey://foo.bar.com:12345')
r.ping()

After that, you probably want to run valkey commands.

Valkey Command Functions#

Module Documentation#

Contributing#

License#

This project is licensed under the MIT license.