Skip to content

Latest commit

 

History

History
85 lines (58 loc) · 1.87 KB

index.rst

File metadata and controls

85 lines (58 loc) · 1.87 KB

Welcome to redis-py's documentation!

Getting Started

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

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

Quickly connecting to redis

There are two quick ways to connect to Redis.

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

import redis
r = redis.Redis()
r.ping()

Running redis on foo.bar.com, port 12345

import redis
r = redis.Redis(host='foo.bar.com', port=12345)
r.ping()

Another example with foo.bar.com, port 12345

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

After that, you probably want to run redis commands.

.. toctree::
   :hidden:

   genindex

Redis Command Functions

.. toctree::
   :maxdepth: 2

   commands
   redismodules

Module Documentation

.. toctree::
   :maxdepth: 1

   backoff
   connections
   exceptions
   lock
   retry
   examples

Contributing

License

This projectis licensed under the MIT license.